Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DLL with memory leaks
Message
De
11/01/2013 09:51:48
 
 
À
11/01/2013 04:13:01
Thomas Ganss (En ligne)
Main Trend
Frankfurt, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01562066
Message ID:
01562145
Vues:
65
J'aime (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. :-)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform