On 04/09/2011 09:55 AM, Holger Hans Peter Freyther wrote:
Hi Paolo,
my postgres code is now working like it should and to test it I was letting it
run in a loop and I see that there is an increase in usage of memory. My first
try was to use ObjectMemory to force a global garbage collect but that did not
change anything, I will try with compacting heaps now as well.
Do you have any strategy to find memory leaks? How is this Eden working? If an
Object is moved there it will never be GCed?
No, absolutely not! Objects are always GCed. Eden is where objects are
_born_, and until they are in the eden reclaiming them is particularly
efficient.
To find memory leaks, I suggest you use instanceCount and find objects
with a very large number of instances. From there, finding the owners
(which may not have a very large number of instances, but are the roots
of the leak) is usually easy. Possibly you can do something like
x := SomeClass someInstance.
[o := x allOwners. o isEmpty] whileTrue: [ x := x nextInstance ].
(o collect: [ :each |each class]) asBag
and recurse on the classes shown in the bag.
Usually, saving the image and doing the above in the REPL will also be
useful to find leaks.
I believe the archives have some information on finding leaks related to
Iliad (July 2009, should be).
Paolo
_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk