Re: R-alpha: memory exhausted

Paul Gilbert (
Wed, 27 Mar 1996 15:17:16 -0500

Date: Wed, 27 Mar 1996 15:17:16 -0500
From: (Paul Gilbert)
Subject: Re: R-alpha: memory exhausted
Message-Id: <>

I can't get
	R -n200000 -v20
to do anything but give "invalid ... ignored"
I print some info: warning: invalid vector heap (-n) size (-536871876)ignored

Either I've messed up something while fooling around, or your getting
the values from someplace other than the command line argument.

I also don't understand the logic of an error if value < R_NSize in
		if(value < R_NSize || value > 1000000)
			REprintf("warning: invalid vector heap size ignored\n");

In the end I hard coded 
   R_NSize = 200000;
   R_VSize = 20 * 1000000;
into UNIXsystem.c and have been able to load most of my functions, and
apparently save them when I q(), but so far I haven't been able to
reload the image when I restart.

Also, there seems to be a problem with UseMethod as illustrated by the
> zot <- function(x) UseMethod("zot")
> zot.zzz <- function(x) x*2
> z <- 2
> class(z) <- "zzz"
> zot(z)
Error in UseMethod("zot") : too few arguments to UseMethod

I use classes and methods extensively.

>One last point about GC.  The fundamental theorem of memory management
>says that your program should not use more memory than the available
>RAM.  At that point page faulting kicks in and you lose in a major
>way.  I would postulate that all of S's performance problems stem from
>the fact that it allows the heap to grow VERY large and then paging
>ties up the disk while the cpu sits idle.

On some systems it would be very restrictive to not use more memory
than available RAM (what's swap for anyway?). I know little about this,
but, it seems to me the trick is that you don't want the code jumping
all over the place in its memory space, so swapping can be fairly
efficient. S does grow very large in loops (I believe because it
doesn't do any garbage collection until the loop finishes) and gets so
large that swapping does kill you. However, if I apply the same rule to
S as you're suggesting for R (ie. don't run any big programs) then it is
pretty fast.

r-testers mailing list -- To (un)subscribe, send
subscribe	or	unsubscribe
(in the "body", not the subject !)  To: