[comp.lang.smalltalk] Running out of memory with PPS 2.5

dr1b@cive.ri.cmu.edu (Dionysis Rigopoulos) (04/13/91)

I just run into this problem and the tech support at ParcPlace opens
again on Monday, so I thought I may get some help from the net...
(May be after all some of the ParcPlace guys read this bboard during the
weekends :-) )
   I am trying to transfer the code I developed in version 2.3 to Objectworks
2.5 and run out of space (on a Mac ci with 8 MB of memory, where memory
should not be a problem).
   I run Objectworks under multifinder, so I played with different values
of required memory, and was surprised by the results:
With 4000 K of required memory, after garbage collecting I have 792036 free
bytes. With 6971 K of memory, I only get 1421900 free bytes. Where do the
remaining bytes of the addional memory go? Actually, I had the exact same
memory problem with a 386 some months ago, and blamed the machine.
   The code I try to file in is about 240 K, but I very very early run out of
space (after filing in about 1/15 of it - less than 20 methods!!)
   Any suggestions, opinions, statements of sympathy, are badly needed...
      Thanks,
     Dionysis
-- 
Dionysis R. Rigopoulos

dr1b@cive.ri.cmu.edu

warner@scubed.com (Ken Warner) (04/14/91)

In article <12659@pt.cs.cmu.edu> dr1b@cive.ri.cmu.edu (Dionysis Rigopoulos) writes:
[stuff deleted]
>   I am trying to transfer the code I developed in version 2.3 to Objectworks
>2.5 and run out of space (on a Mac ci with 8 MB of memory, where memory
[etc]
>   I run Objectworks under multifinder, so I played with different values
>of required memory, and was surprised by the results:
>With 4000 K of required memory, after garbage collecting I have 792036 free
>bytes. With 6971 K of memory, I only get 1421900 free bytes. Where do the

Forget the numbers, they don't tell you anything useful.

I run large (>4 meg) images all the time on a Mac II and IIcx.  The
tricks I use:

First get 16 Meg of real memory and Maxima from Connectix.  If you can't 
swing 16 Meg of real memory get Virtual from Connectix.  Both give you a little
over 14 Meg of memory *UNDER FINDER*.  Under MultiFinder you will only get 
8 Meg - System - Finder memory *THIS IS IT...ALL YOU GET...YOU DON'T
GET NO MORE!*   I have the application memory size set to 7000k and my 
System cut down to a little less than 1 Meg.  Few INIT's, CDEV's and/or
DA's.  Configured this way I can run Smalltalk with a 4+ Meg image, MS-Word
and a draw program.  But I garbage collect *ALOT*.

So if I have a lot of hacking to do and I don't want to garbage collect
every 4 minutes, I run under Finder.  Finder will let you use all 14 Meg
of memory.  It works great! Remember I'm using Connectix stuff.

Last meaningful trick:

Inspect Object class variable DependentFields.  This guy can sponge up
a lot of zombies.  But be careful what you loose from DependenFields--you
can really hose yourself.

Cheers!

Ken Warner
warner@scubed.scubed.com

ags@scs.carleton.ca (Alexander George Morison Smith) (04/15/91)

In article <12659@pt.cs.cmu.edu> dr1b@cive.ri.cmu.edu (Dionysis Rigopoulos) writes:
>   I am trying to transfer the code I developed in version 2.3 to Objectworks
>2.5 and run out of space (on a Mac ci with 8 MB of memory, where memory
>should not be a problem).

I just use 2.3 :-) You can probably fix your problem with out of memory
during file-in by inserting a few Smalltalk garbageCollect (or whatever
the method name is) in appropriate places in the file you are filing in. 
That way it will do a garbage collect and give you more free memory /
objects for the rest of the file-in.  It seems that garbage collection
isn't as automatic as we users wish it is during file-in and other
times. 

By the way, if you creat a huge object in 2.5 and then dereference it,
you will find that you have more free memory after dereferencing it than
before creating it.  I susupect that PP 2.5 only allocates memory from
the Mac OS as it needs it. 

- Alex