[R] Memory leak in system() command?

Rob Steele R.7.robsteele at xoxy.net
Tue Sep 7 06:05:00 CEST 2010


I run an external program a few hundred times via

status <- system(command = "blah blah blah")

and pretty soon Linux thinks R is using tons of memory.  R doesn't think
so, at least not according to gc().  I'm also opening, reading and
closing files but I don't think that's where the problem lies.
Eventually the system command fails with a status of -1 and a message like:

cannot popen 'blah blah blah', probable reason 'Cannot allocate memory'

Any ideas?
Thanks!

> R.Version()
$platform
[1] "x86_64-redhat-linux-gnu"

$arch
[1] "x86_64"

$os
[1] "linux-gnu"

$system
[1] "x86_64, linux-gnu"

$status
[1] ""

$major
[1] "2"

$minor
[1] "11.1"

$year
[1] "2010"

$month
[1] "05"

$day
[1] "31"

$`svn rev`
[1] "52157"

$language
[1] "R"

$version.string
[1] "R version 2.11.1 (2010-05-31)"



More information about the R-help mailing list