[rkward-devel] memory management

Prasenjit Kapat kapatp at gmail.com
Sun May 6 05:58:50 UTC 2012


On Sat, May 5, 2012 at 6:10 PM, meik michalke
<meik.michalke at uni-duesseldorf.de> wrote:
> hi,
>
> over the past few days, i collected some amount of data, i.e. a script
> examined more than 120.000 XML documents. for a while this ran just fine, but
> at a certain point the machine ran out of RAM. i then included a manual call
> to gc() in the loop, which actually already removed all processed objects with
> rm() so i didn't think i'd run into problems, but that still didn't really
> help as much as i had thought.
>
> i just examined this a bit. calling gc() in RKWard *looks* like it really
> frees memory, but on the system level i don't notice a significant reduction.
> only after i close RKWard the memory level goes back considerably. can it be
> that the memory freed by R is still occupied by RKWard throughout a session?

I just tried

x <- rnorm (10^8)
# wait
rm (x)
invisible (gc ())

and I can see the memory usage fall in htop as well as /proc/meminfo.
Here is essential part of /proc/meminfo:

Before rnorm ():
MemTotal:        3914192 kB
MemFree:         2325700 kB
Buffers:            9932 kB
Cached:           211476 kB
SwapCached:       279992 kB
Active:           890012 kB

Before gc ()
MemTotal:        3914192 kB
MemFree:         1558384 kB
Buffers:            9976 kB
Cached:           211500 kB
SwapCached:       279404 kB
Active:          1656728 kB

After gc ()
MemTotal:        3914192 kB
MemFree:         2340744 kB
Buffers:           10004 kB
Cached:           211532 kB
SwapCached:       279480 kB
Active:           875420 kB

After closing rkward:
MemTotal:        3914192 kB
MemFree:         2406108 kB
Buffers:           10012 kB
Cached:           211528 kB
SwapCached:       279468 kB
Active:           811044 kB



> viele grüße :: m.eik

-- 
Prasenjit




More information about the Rkward-devel mailing list