gdal memory load

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

gdal memory load

Marco Vieira
Hi list.
 I perceived that mapserver was not freeing memory after requests then i
tested the memory load in some situations and noticed that this only
happen in with raster databases (with gdal procedures). I tried than the
same with gdalwarp command and got the same.
My test:
gdalwarp -s_srs +proj=tmerc +ellps=intl +k_0=0.9996 +x_0=500000
+y_0=10000000 +lat_0=0 +lon_0=-45 -t_srs +proj=latlong +ellps=WGS84
foo.tif foobar.tif

(foo.tif has 597M)

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)?

my system:
gdal 1.3.0
geos 1.1.4
mapserv 4.6.1
Linux 2.6.8-2-386 (debian)
gcc 4.0.1

Thanks.

Marco Vieira.
Fone:    + 55 21 9499-6800
[hidden email]
_______________________________________________
Gdal-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: gdal memory load

Frank Warmerdam-2
On 9/12/05, Marco Vieira <[hidden email]> 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@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, [hidden email]
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

_______________________________________________
Gdal-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/gdal-dev