Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DLL with memory leaks
Message
From
11/01/2013 09:51:48
 
 
To
11/01/2013 04:13:01
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01562066
Message ID:
01562145
Views:
66
Likes (1)
>>Does anybody know if issuing CLEAR DLLS will clear the dll in such a way that
>>any memory it leaked during execution is reclaimed before the app instance
>>truly terminates?
>>I have a DLL that does this from time to time. I'd like to just CLEAR DLLS it out
>>from time to time by name and then immediately re-load it --- if this would work. :-)
>
>Dunno and doubt it - but keep us posted of your findings.


It works. Yes, CLEAR DLLS _does_ remove the allocated memory from the DLL.

Methodology:
I created a custom DLL and test program which called the DLL and repeatedly allocated memory in 256MB blocks within the DLL using maloc(), but without an associated free(). It was in a loop and allocated about 2 GB of memory. This was visible in the Windows Task Manager as a sudden sharp increase in the graph on the "Performance" page, as well as the memory allocated on the "Processes" page. It climbed from about 5MB at startup to over 2GB while stepping through code. Then, when CLEAR DLLS was issued, it dropped back down to 5MB.

So ... problem solved. Crisis averted. :-)
Previous
Reply
Map
View

Click here to load this message in the networking platform