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

Benoît Minisini g4mba5 at gmail.com
Tue Mar 13 20:29:31 CET 2018


Le 13/03/2018 à 20:25, Yahoo via User a écrit :
> 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
> 

Yes, you can have a memory leak inside a component, but first you must 
be sure that it is not in your code, i.e. that objects don't accumulate.

-- 
Benoît Minisini


More information about the User mailing list