Re: [S] Avoid for loops !!!

Prof Brian D Ripley (
Thu, 19 Nov 1998 07:31:26 +0000 (GMT)

On Wed, 18 Nov 1998, Brian Beckage wrote:

> I've had similar problems using the new Splus 5 on a sun station. But
> when I ran the same code using Splus 3.3, it ran fine and never exceeded
> 40MB. So it appears that 5.0 may have some memory leak problems.

[The international space station is due for first launch today!]

Hmm. As someone running S-PLUS on a mere Sun UltraSparc I may have fewer
resources, but for me S-PLUS 5 takes more than 40Mb virtual memory to get
started (46Mb just now), and the experiments Bill Venables and I showed at
our Washington course


show that the memory usage of 5.0 is quite different from 3.4, so that what
is memory-efficient coding is not in the other. But that extra 40Mb or so
to start with means that you need a large amount of memory before 5.0 wins
in most problems.

I think your conclusion (memory leaks) is a leap in the dark, but 5.0
does use more resources for small problems than 3.4, and when I asked
someone at MathSoft what was meant by large he said `tens of thousands of

As for the original question (avoid for loops) there really is a lot
written about it, not least by Bill and I in our book, our on-line
complements and that course.


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