[gradsusr] 'flush' command does not work
Brandon Schmidt
admin at wilmingtonwx.com
Thu Mar 19 02:01:11 EDT 2015
Through extensive debugging, I've found that the GrADS *flush* function
does not work properly. This first came to my realization when I began to
automate my GrADS scripts. Each script processes a single hour by
downloading a GRIB file, creating a control file, opening the control file,
and displaying/outputting the needed data. The scripts initialize with
right around 100 MB of memory but through execution, they can rack up as
much as 1.4 GB. Of course when processing multiple hours, this slowed my
server to a crawl and in some cases caused crashes (especially with
high-res HRRR data for example). Anyway, I traced the excessive memory
usage to the display commands. I am aware that with each display command,
the displayed variable is stored to the GrADS GRIB2 cache to eliminate
further decompression overhead. This is all well given the *flush* command
but it seems to only work half of the time. One can easily see this by
noting the initial memory, displaying a few variables, flushing, and then
noting the final memory. Seemingly randomly, the memory following a flush
will slowly creep up. The behavior memory-wise that I expected from *flush* can
only be obtained with *reinit* but calling that function thousands of times
is not an option. Any ideas as to a work-around or fix? I am using the
latest 2.1.a3 version. The first *flush* below works but the second does
not.
-Brandon
---------------------------------------------------------------------------------
ga-> !pgrep grads
7879
ga-> ! ps -p 7879 -o %mem,size
%MEM SZ
1.3 87276
ga-> d tmp2m
Notice: Automatic Grid Interpolation Taking Place
Contouring: 255 to 305 interval 5
ga-> ! ps -p 7879 -o %mem,size
%MEM SZ
1.7 108024
ga-> d capesfc
Notice: Automatic Grid Interpolation Taking Place
Contouring: 0 to 3500 interval 500
ga-> set lat 50 70
LAT set to 50 70
ga-> d gustsfc
Notice: Automatic Grid Interpolation Taking Place
Contouring: 1 to 13 interval 1
ga-> set lat 20 90
LAT set to 20 90
ga-> d tmp2m
Notice: Automatic Grid Interpolation Taking Place
Contouring: 255 to 305 interval 5
ga-> flush
grib2 cache cleared
ga-> ! ps -p 7879 -o %mem,size
%MEM SZ
1.7 108024
ga-> d tmp2m
Notice: Automatic Grid Interpolation Taking Place
Contouring: 255 to 305 interval 5
ga-> ! ps -p 7879 -o %mem,size
%MEM SZ
1.9 122908
ga-> flush
grib2 cache cleared
ga-> ! ps -p 7879 -o %mem,size
%MEM SZ
1.9 122908
ga->
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20150319/dc4ff509/attachment.html
More information about the gradsusr
mailing list