Re: [S] Memory problem with S-PLUS 5.0?

Prof Brian Ripley (
Thu, 19 Nov 1998 17:30:58 +0000 (GMT)

> From: Pierre Duchesne <duchesne@DMS.UMontreal.CA>
> Here is a simple experiment that I tried with Splus 3.4
> and Splus 5.0 on a Sun Ultra 60 with 768 M of RAM.
> fun <- function()
> {
> apply( array(rnorm(9*10000),dim=c(3,3,10000)), 3, solve)
> }
> It seems to me that it is a efficient way to invert 10000 3x3
> matrix.
> If I look to the memory taken by Splus 3.4, it took less that 2 minutes
> to do the work, and the memory taken never exceeded 20M.
> However, if I use the same program under Splus 5.0, I was forced to
> kill the job after 3 minutes since I was already taking more that 300 M.
> My function was quite simple, without any for, and was using an
> efficient function like apply().

Ah, that is 3.4-speak. Try listing apply, find it calls lapply and
then list lapply to see the for loop.

Please, S-PLUS 5.0 is not an `upgrade' it is a new system with a high
degree of backwards compatibility. Do remember that many (most?) of
the efficiency tips you learnt in S-PLUS 3.x may be wrong or even
harmful in 5.0. I don't think any of us yet know enough about the
possible tricks, but here I would try a for loop (actually I did try,
but my version of 5.0 gave me errors of `too many open files').

May I suggest that reporting simple things that do not work well in 5.0
is not very helpful. Reporting useful tricks would be very helpful.

Let me repeat, Bill Venables has documented a useful series of
experiments in the Washington workshop notes, and let us take that level
of experiment as known.

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

----------------------------------------------------------------------- This message was distributed by To unsubscribe send e-mail to with the BODY of the message: unsubscribe s-news