zeroc-ice / datastorm

Data centric pub/sub framework based on Ice
GNU General Public License v2.0
13 stars 7 forks source link

steady memory leaks with ICE when broadcasting proxy with DataStorm #13

Closed zengdaiwei closed 2 years ago

zengdaiwei commented 2 years ago

Version(please complete the following information):

Describe the bug 1, create a Proxy with DataStorm::Node's communicator, then broadcast the proxy. 2, If the proxy is not received by any Client, try to destroy it. 3, repeat step 1、2 4, obvious memory leak shown in VS analyzer;

here is my demo project to show the bug: https://github.com/zengdaiwei/ICEMemoryLeak.git run with visual studio 2019, compile and run; just keep "Enter" key down for a minutes or so, to reproduce the problem.

Expected behavior no steady memory leaks with "creating proxy"--"broadcasting proxy"--"destroy proxy" loops.

Additional context test projects to reproduce the bug: https://github.com/zengdaiwei/ICEMemoryLeak.git

bentoi commented 2 years ago

You don't indicate if you're using DataStorm 1.0 or the GitHub latest version. If you're using 1.0, can you try to build DataStorm from the GitHub repository and see if this fixes the problem?

zengdaiwei commented 2 years ago

I used nuget from https://nuget.cdn.azure, which has only DataStorm 1.0.0; As you suggested, I compiled the latest-version DataStorm GitHub, and tried it with the test project "https://github.com/zengdaiwei/ICEMemoryLeak.git" again. The leaking problem still exists. I am sure the latest DataStorm code is used. Please have a look at the test code and take a little time to try it out.

bentoi commented 2 years ago

Sorry for the late feedback on this one. There's a leak in your test case, you should call adapter->destroy() instead of just adapter->deactivate(). Can you try again with this fix?

zengdaiwei commented 2 years ago

It works. Thanks.