Memory leak when using SSL sockets
We use persistent SSL sockets on almost every page request. With HHVM, this seems to cause memory usage to increase over time. If we don't use SSL sockets, but still use persistent sockets, the memory leak seems to go away. It's possible my pull request #6329 caused this or perhaps it has always been an issue.
The code bug that's causing this was not immediately obvious to me. I did notice in a small test case (test/slow/ext_socket/persistent_socket.php) that the number of calls to the constructor and destructor of SSLSocket and SSLSocketData is as expected.
The leak is easily noticeable for us. It takes about 2 hours to burn through 48GB of RAM with a request rate of around 100 requests/sec.
I found a leak that's relatively easy to repro. If you just create SSL connections over and over, you'll see the leak fairly quickly. For persistent sockets, the leak will show up when the persistent connection has been closed or failed and it makes a new one. I have a fix for this specific leak. I'll create a pull request once we verify it fixes what we were seeing in production.
What's the proper way to write a test case against a memory leak? An existing example would be fine. Or should I not worry about it?