From N.J.Lee@statslab.cam.ac.uk  Tue Apr 13 13:59:17 1999
From: N.J.Lee@statslab.cam.ac.uk (Nicholas Lee)
Date: Tue, 13 Apr 1999 13:59:17 +0100 (BST)
Subject: --nsize and --vsize
In-Reply-To: <199904131053.LAA17041@toucan.stats.ox.ac.uk>
Message-ID: <Pine.HPP.3.96.990413124738.25580A-100000@tiger.statslab.cam.ac.uk>


On Tue, 13 Apr 1999, Prof Brian Ripley wrote:

> > The flags exist, but in the adage of the lazy programmer, "less
> > keystrokes, means less RSI/bugs."   One nice option would be for R to probe


Here is a quick solution in the R.sh.in file: (Although it might be nicer
to do this via getenv("R_VSIZE") in the system.c) 

[ -f ${HOME}/.Renviron ] && . ${HOME}/.Renviron
[ "$R_VSIZE" != "" ] && ARG_STACK="$ARG_STACK --vsize $R_VSIZE"
[ "$R_NSIZE" != "" ] && ARG_STACK="$ARG_STACK --nsize $R_NSIZE"

exec ${RHOME}/bin/${RBINARY} $ARG_STACK "$@"


The only problem with this is:
-->8--
$ echo "R_VSIZE=20M" > ~/.Renviron  (or export R_VSIZE=20M)
$ R --vsize 4M
WARNING: invalid v(ector heap)size '4194304' ignored;using default = 20M

R : Copyright 1999, The R Development Core Team
[...]
> 
-->8--

I assume that --(v|n)size should override enviroment defaults?  

So we could fix that, by accepting the second --vsize option from $@,
instead of the first --vsize from the $ARG_STACK. 

That probably means some mickying around with: 

if(value < R_NSize || value > Max_Nsize) 
    REprintf("WARNING: ...
else
    R_NSize = value;


So what should the default action be?

> > the size of the .RData file, and rather than dieing on you if it's too
> > large, giving you option of loading it with XX extra memory.

Since InitMemory() is called before R_InitialData(), this might be
trickly.  Either involving some magic in the shell script wrapper or
pre-checking the size of the .RData file before calling InitMemory.


Nicholas

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


--nsize and --vsize
Nicholas Lee