[Rd] .Internal(quit(...)): system call failed: Cannot allocate memory

Tomas Kalibera tom@@@k@||ber@ @end|ng |rom gm@||@com
Mon Nov 23 12:14:52 CET 2020

On 11/21/20 6:51 PM, Jan Gorecki wrote:
> Dear R-developers,
> Some of the more fat scripts (50+ GB mem used by R) that I am running,
> when they finish they do quit with q("no", status=0)
> Quite often it happens that there is an extra stderr output produced
> at the very end which looks like this:
> Warning message:
> In .Internal(quit(save, status, runLast)) :
>    system call failed: Cannot allocate memory
> Is there any way to avoid this kind of warnings? I am using stderr
> output for detecting failures in scripts and this warning is a false
> positive of a failure.
> Maybe quit function could wait little bit longer trying to allocate
> before it raises this warning?

If you see this warning, some call to system() or system2() or similar, 
which executes an external program, failed to even run a shell to run 
that external program, because there was not enough memory. You should 
be able to find out where it happens by checking the exit status of 


> Best regards,
> Jan Gorecki
> ______________________________________________
> R-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

More information about the R-devel mailing list