[Gambas-user] How to audit memory consumption in Gambas project

Yahoo olivier.cruilles at yahoo.fr
Tue Mar 13 20:25:48 CET 2018


Benoit,

I’m not sure to understand correctly but I already count each Object[] / Collection / String[] / Task, etc… that I use all long the process run and for example at the end of each Task, I delete or assign to NULL each Arrays or Object.

Normally I’m able to figure where the memory is not released but in this case I can find it.

This process receive many data on a Socket File -> Store Data to a Collection -> Translate all this Collection to a Class[] -> Flush this Class[] to disk over Tasks -> Release this Class[] -> repeat this cycle

The only Array still growing is the Collection containing the Data because this is the Aggregation Array.

So now, to prevent a crash of the process, I have implemented a king of journal that is a backup of the Data Collection into a Json file that I can reload at the startup if it present. In this case I can see that after a big Data Collection reloaded into the memory I never exceed 30MB of memory (process + Data Collection loaded) but after 24h running, the process take more than 1GB of memory. 

Could the Socket File does not release any memory or Task allocation is not released in some case because I start a tone of they ? 

Olivier
Le March 13, 2018 à 14:52:02, Benoît Minisini (g4mba5 at gmail.com) a écrit:

Class.Count
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20180313/8be9fe2b/attachment-0001.html>


More information about the User mailing list