help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] the garbage collector is not doing its job


From: Derek Zhou
Subject: [Help-smalltalk] the garbage collector is not doing its job
Date: Sat, 17 Jan 2009 13:21:00 -0800
User-agent: KMail/1.9.9

Paolo and all,
It seems like the global garbage collector is not doing a good job collecting 
all the garbages and effectively gst is leaking memory:
... after loading my program:
st> ObjectMemory current oldSpaceUsedBytes
860160
... running my program for a while:
"Global garbage collection... done, heap grown"
"Global garbage collection... done, heap grown"
"Global garbage collection... done, heap grown"
"Global garbage collection... done, heap grown"
"Global garbage collection... done, heap grown"
"Global garbage collection... done, heap grown"
"Global garbage collection... done, heap grown"
"Global garbage collection... done, heap grown"
"Global garbage collection... done, heap grown"
"Global garbage collection... done, heap grown"
"Global garbage collection... done, heap grown"
"Global garbage collection... done, heap grown"
st> ObjectMemory current oldSpaceUsedBytes
65335296
st> ObjectMemory current oldSpaceSize
97719216
So the heap keep growing. But most of it are really garbages:
st> ObjectMemory compact
"Global garbage collection... done"
ObjectMemory
st> ObjectMemory current oldSpaceUsedBytes
880640
So far the only ways I found to really reclaim memory are either "ObjectMemory 
compact" or back to back "ObjectMemory globalGarbageCollect"; a 
single "globalGarbageCollect" won't do. Right now I work around the problem 
by sprinkle my code with "ObjectMemory compact" but that sounds silly, isn't 
it?
A few more observations:
* It happends for both 3.0.3 and 3.0.5. I haven't tried the 3.1 branch.
* If I leave my program running for a long time gst will run out of memory and 
crash. After then hack (inserting compact at various places) my program can 
practically run forever and heap never grows.
* This will only happen when the working data set is more than a few hundred 
KB. I cannot reproduce it with a small data set.
* The rate of leaking is similar between 3.0.3 and 3.0.5; however there is a 
difference still: 3.0.3 will slow down dramatically when the leaking is high; 
while 3.0.5's speed is not affected as much.
Any idea?
Thanks a lot
Derek Zhou
     




reply via email to

[Prev in Thread] Current Thread [Next in Thread]