[kaffe] Compare kaffe and IBMJava2-131 Java Virtual Machine.

Dalibor Topic robilad@yahoo.com
Tue Mar 11 00:24:01 2003


--0-2100487839-1047371154=:19022
Content-Type: text/plain; charset=us-ascii
Content-Id: 
Content-Disposition: inline

hi Greg,

--- Greg Wooledge <greg@wooledge.org> wrote:
> Dalibor Topic (robilad@yahoo.com) wrote:

> I started up Freenet with those switches (without my
> normal -mx 224M)
> and then beat upon it vigorously with local
> requests.

thanks for the data. I've looked through it, and there
is a ton of java.lang.Objects, followed by
HashMap.Entrys, with freenet/fs/dir/NativeFSDirectory
following way behind it. Freenet seems to use Objects
mostly for synchronization purposes, but I haven't
found out what all these HashMap.Entries are for.

So I wrote a small test program that counts stack
traces, attached.

Could you inject the ObjectCounter code into the
java.util.HashMap class, add a call to it in the
HashMap Entry constructor and add a call to print out
the trace cache in Runtime.exit()? I am really
interested who is allocating all these little things
;)

I could also provide you with a patch tonight, if
that's easier for you.

> You may notice that at one point, an
> OutOfMemoryError is also printed.
> This appears to have come from Freenet's stderr:
> 
> java.lang.OutOfMemoryError
>         at
>
freenet.thread.QThreadFactory$QThread.run(QThreadFactory.java:218)
> 
> I don't know whether it's relevant.

Couldn't say, I haven't looked extensively at
freenet's source code. I've seen that Freenet uses a
lot of its own collections types, so I'm not sure
where kaffe is leaking the memory. I'd suspect some
collection class leaves HashMap.Entries around linked
to by an iterator or something like that.

cheers,
dalibor topic


__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com
--0-2100487839-1047371154=:19022
Content-Type: application/octet-stream; name="GCTest.java"
Content-Transfer-Encoding: base64
Content-Description: GCTest.java
Content-Disposition: attachment; filename="GCTest.java"

aW1wb3J0IGphdmEuaW8uKjsKaW1wb3J0IGphdmEudXRpbC4qOwoKcHVibGlj
IGNsYXNzIEdDVGVzdCB7CgoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0
cmluZyBbXSBhcmdzKSB7CgkJZm9yIChpbnQgaSA9I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