-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak in C++/EMA (in OmmConsumer/OmmLoggerClient) #118
Comments
@pabk-ovka Thank you for submitting your issue with the detailed information. This will be tracked and once it is addressed, it will be included in a future release. |
@pabk-ovka I have ran yours test code for 20 iterations in the while loop to create and destroy OmmConsumer using the LoggerType::File option with Valgrind(Memcheck) tool and let the application exits normally without any interruptions with Ctrl+C. Also, the Consumer application doesn't connect to a provider application and receives the OmmInvalidUsageException for the login timeout. I haven't found any memory leak related to the OmmLoggerClient as the allocated memory in OmmLoggerClient::openLogFile() is free in OmmLoggerClient::closeLogFile() when the OmmConsumer is being destroyed. However, I found the following memory leak from the Valgrind which will be fixed in next release. ==2059== |
@soranat , thank you for the investigation. I am not sure if I understand correctly your statement:
In my case, the consumer application connects just fine, does not receive any timeout (Of course the host and password values in the attached code snippet are just an example as I did not want to reveal the real values.). So I am just wondering if we are on the page - running the same scenario. |
@pabk-ovka I did test yours scenario as well when the Consumer application can connect with a provider without any OmmInvalidUsageException regarding the login timeout to verify both scenarios. I notice the memory growth with the consumer application only on Windows platform and the OS releases the memory before the application exits. I will investigate more and get back to you. |
I found the root case that the Consumer application consumes memory exponentially because there is a defect in the OmmLoggerClient::openLogFile() method causing the LoggerClientFiles.openFilesSize variable is multiplied by 2 for every additional OmmConsumer instances after destroying the previous one from the following condition and its memory allocation.
This memory consumption issue will be fixed in the next release as well. Please let me know if you have any questions. |
@soranat , that's great news. The bug you described exactly matches the symptoms. We are looking forward to the next release. Thank you. |
@pabk-ovka ESDK1.4.0.L1 has been released and include a fix to address this issue. Please re-open if ou find otherwise. Thank you. |
@vlevendel , thank you, we'll upgrade to 1.4 and let you know if issue persists. |
It looks like there is a significant memory leak in the C++ version of EMA.
SDK version: 1.3.1.L1 (Latest)
Please consider the following code:
It takes only 27 iterations (create consumer, destroy consumer) to reach roughly 16 GB of memory usage. According to the attached snapshot below it looks like OmmLoggerClient is flawed.
It should really be possible to open a connection to the data feed and later close it without leaving a memory trace. Especially if the app needs to reopen the connection several times during the app's lifecycle.
The text was updated successfully, but these errors were encountered: