[maemo-developers] C - Hildon - Memory usage

From: David Hautbois david.hautbois at free.fr
Date: Tue Feb 12 22:28:33 EET 2008
david at saturne:~$ awk '/Private_Dirty/{sum+=$2}END{print sum "kB"}' 
/proc/11468/smaps
272kB

It's better....

Thanks.

David.

Eero Tamminen wrote:
> Hi,
>
> ext Markku Vire wrote:
>> HildonFileChooser can temporarily allocate large amounts of memory.
>> This goes away after all references to the chooser are removed.
>>
>> However, the heap can shrink only when the topmost allocation is free'd.
>> This means that
>>
>>    XXX.....................Y
>>
>> the last allocation (Y) is preventing the free memory between X and Y to
>> be released back to system. In your example you're leaking
>> chooser_filename. With enough bad luck it can keep your process from
>> freeing memory it doesn't need anymore...
>>
>> However, the VMSize is *not* a good way to measure memory usage. You
>> should check private dirty memory instead.
>
> With for example something like this:
> awk '/Private_Dirty/{sum+=$2}END{print sum "kB"}' /proc/$(pidof 
> myprogram)/smaps
>
>
>     - Eero
>

-- 
Web site : http://david.hautbois.free.fr
Tablet users map : http://david.hautbois.free.fr/maps/index.php



More information about the maemo-developers mailing list