-
Notifications
You must be signed in to change notification settings - Fork 129
Description
I am listening ~100 web sockets from binance.com to keep up with live transactions(every single buy and sell order).
I have been having memory leak problems for a long time and have to restart my application after 3-4 hours. Because I am running out of my 32gb ram.
Now I want to listening order book data as well(supply and demand book) but my applications just run out of memory after 5 mins.
I use many different tools to find where is leak. The best was gprefd. I found out there were too many allocations from OpenSSL and Arsd.
I used gdb and put breakpoints to malloc to confirm that and the stack trace always showed OpenSSLSocket's send and receive.
I changed the "int pingFrequency = 5000;" to a very big number and now I can run my application for 6-8 hours without running out of memory. But the memory leak still continues because I just controlled the pings that we send but also my server(binance.com) sends me pong approximately every 3 minutes. And pongs uses the same OpenSSLSocket class and its leaking functions send&recieve.
I can attach the gdb stack outputs and gpref results if it is requested.
Thanks for the awesome Arsd library, I removed all vibe.d stuff and replaced it with Arsd :)