users@glassfish.java.net

Re: EJBClassLoader - huge number of streams

From: <glassfish_at_javadesktop.org>
Date: Fri, 29 Oct 2010 05:17:30 PDT

Thanks Richard and Tim for your responses.

@Richard
The technology stack I have for this is spring, dwr and hibernate.
The web-application is packaged into a ear file amongst other web-apps.
The JDK been used is 1.6.0_15

I can create a sample application, that represents the functionality, but unfortunately not quick enough amongst the other things going on. In terms of reproducing this a high load needs to be applied though. If this is the last resort to getting to the bottom of it, I guess I'll have to find sometime and knock something out for you. Although you would have to apply a high load (at least 20 per second) to reproduce it.

@Tim
Getting on to No.2 of your comments, my application doesn't open an explicit stream to the jar file I've seen in these streams. This requests are issued against a specific servlet (A DWR servlet) which is in the jar file I see been opened.
And from what I've seen in the DWR servlet code, there's nothing that's opening any resource to this jar file. So I would imagine this to be standard servlet execution.
I see a method getResourceAsStream(final String name) in the EJBClassLoader which seems to be creating new SentinelInputStream objects. But I can't claim I've figured out where and who actually calls this method - perhaps you might be able to shed some light on that.
And then there is a closeOpenStreams() method which is getting called on the done() method of EJBClassLoader which says (from the javadoc) to be assisting garbage collection. Again, not sure where and what calls this method. A check on the doneCalled variable seems to return from the method without going onto closing streams. Not sure if this has any wired behaviour.
I'm just thinking out loud here looking only at the EJBClassLoader. So bare with me if this sounds more like a rant.
I've been trying to get my hands on the glassfish code for the version I'm using, and I must be looking at the wrong places because I cant find out where I can get it from. Would you be able to point me to any svn repositories (if any) where I can find it.
Let me know if what I've mentioned above makes any sense to you from your know-how of the EJBClassLoader. Thanks!!

Oh also, as an aside - I've done some profiling of this user journey (admittedly on tomcat and not with the same load) and haven't noticed any memory leaks.

Cheers
-- Imran
[Message sent by forum member 'imranbohoran']

http://forums.java.net/jive/thread.jspa?messageID=486488