running out of memory?

David T. Lewis lewis at mail.msen.com
Sun Dec 14 15:19:35 UTC 2003


On Sun, Dec 14, 2003 at 03:37:34AM -0500, Ralph Boland wrote:
> I am constructing finite state machines from regular expressions
> and some of the FSMs are large as in 10,000 to 20,000 states,
> when the FSMs get this large I run into severe performance problems.
> For example the debugger is almost impossible to use since it is
> so slow.
> I assume that I am running out of memory but:
> 
> 1) I have 256M of memory which seems to me to be lots to store
>     20,000 states plus all the information needed to construct them
>     all the way back to the tokens from the parser of the regular
>     expression (all of which are actually still around).

You are running Linux, so open up an xosview window and watch what
happens while you are running Squeak. If your Squeak image gets large
enough that it requires virtual memory paging, you will see swap space
being used in the xosview display. If that is happening, your Squeak
performance will be horrible.

Also, with Squeak, check world menu->help->vm statistics to see how
much object memory is being used. On your system (256M physical memory),
if your image is using more than about 200M you are going to start
swapping.

> 2) When I used Smalltalk many years ago (not Squeak) there used to be a 
> different
>     mouse location icon when memory compaction is occurring.  I never
>     see this icon now, even when I have an infinite recursion situation.
>     In this situation I do get a memory low warning just as the system
>     hangs.  (The warning doesn't fit in the window and I can't scroll
>     it because I am then hung!).

There is no such visual indication in Squeak. In my experience, the only
time garbage collection is ever noticable is when I'm doing something
like you describe -- soming really big that just is not wanting to fit
into available physical memory.

Low memory handling apparently does not work right on the Linux VM, for
reasons that have not yet been sorted out, something to do with timing
and event handling or some such. Rather inconvenient.

> 3) One possibility is that Smalltalk is not using all of the available
>     memory.  If this is the case how do I check the amount of used
>     memory and the amount of free memory and how do I change the amount.
>     Are there guidelines for setting this amount.  e.g. X megabytes plus
>     Y percent of the memeory should be left for the operating system.
>     (I am running Smalltalk on Linux and don't usually run anything
>      else at the same time unless I happen to go on the internet.

In the old days (maybe about a year ago), it was necessary to tell the
VM how much memory to allocate for its object memory. Now it works
automagically. There is still a '-memory' command line parameter; I don't
know if it serves any useful purpose, but I just ignore it now.

>     When I am in this situation I know to do a "command .".  However is
>     there not a more extreme command to execute if  "command ." fails
>     to do an interupt?

Unfortunately, no.

HTH,
Dave

p.s. Memory is cheap if you have room to add it to your system :-)




More information about the Squeak-dev mailing list