[Gdal-dev] gdal memory load

Frank Warmerdam fwarmerdam at gmail.com
Mon Sep 12 22:43:05 EDT 2005


On 9/12/05, Marco Vieira <marco_vieira at uk2.net> wrote:
> free command before gdalwarp:
>              total       used       free     shared    buffers     cached
> Mem:        906736     194520     712216          0      10520      98032
> -/+ buffers/cache:      85968     820768
> Swap:      2249060          0    2249060
> ----------
> free during gdalwarp:
>              total       used       free     shared    buffers     cached
> Mem:        906736     902752       3984          0       1364     746280
> -/+ buffers/cache:     155108     751628
> Swap:      2249060        716    2248344
> ----------
> free after gdalwarp:
>              total       used       free     shared    buffers     cached
> Mem:        906736     845860      60876          0       1052     751748
> -/+ buffers/cache:      93060     813676
> Swap:      2249060        716    2248344
> 
> How can I flush memory cached by gdal lib (specially after mapserver
> requests)?

Marco,

I am not aware of significant memory leaks in GDAL and in any event,
once an application finishes all memory used by the process is returned 
to the operating system.  I am no whiz at understanding the output of
the free command, but I read the above as indicating that "cached" went
from 98032 to 751748.  It seems to me that gdalwarp accessed files on disk
and the operating system has kept these in cached in RAM after the 
program finished.  This does not seem like a problem at all. 

For instance, I got this free report on my system.
warmerda at gdal2200[253]% free
             total       used       free     shared    buffers     cached
Mem:       1036816     542456     494360          0        252      66812
-/+ buffers/cache:     475392     561424
Swap:      1228964      46768    1182196

I then ran the command "cp gtopo.tif gtopo2.tif" and then free again and
got:
             total       used       free     shared    buffers     cached
Mem:       1036816     649464     387352          0        372     173564
-/+ buffers/cache:     475528     561288
Swap:      1228964      46764    1182200

As you can see the "cached" number when up quite a bit, but the
free number when down.  That is just because the operating system 
kept gtopo.tif and gtopo2.tif in it's RAM cache.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list