Re: unexpected high cpu load

2010-03-22 Thread Kevan Miller

On Mar 22, 2010, at 2:56 PM, Marco Laponder wrote:

 Hi,
 
 I am experiencing,while running my web application, a very high load on
 the system where Geronimo is running (4 cpu's are busy). 
 
 I tried to find the cause of the problem by sending a kill -3 and
 inspecting the java vm thread dump. I attached it to this mail but I
 couldn't detect the cause of the problem of the CPU usage. 
 
 A number of threads are in the containsKey on the hashmap triggered by
 the getResource on the MultiParentClassLoader which strikes me as odd,
 can this be the source of the problem ? 
 
 Are there other ways to determine why the CPU is load is this heavy? Any
 tips are appreciated. 

One simple test is to create several thread dumps and compare the two. Java 
profiling tools, java debugger, logging, etc. (in no particular order) are 
additional techniques...

Looking at your thread dump, I see 4 threads in 
NavigatorTalkbackMgr.getMessage() doing a wait() (I assume they have a 
relatively long or infinite wait time) and 4 threads in 
MultiParentClassLoader.getResource(). The getResource calls definitely look 
suspicious... 

I'll bet a beverage of choice that there's been a concurrent read/write on the 
resourcesNotFound HashMap, the write thread caused the HashMap to be resized, 
and the read threads are now stuck in an infinite loop in 
HashMap.containsKey(). MultiParentClassLoader.getResource() is definitely wrong 
and needs to prevent concurrent access to the resourcesNotFound HashMap.

Please create a Jira -- patches are also welcome! :)

--kevan

EJB Life Cycle

2010-03-22 Thread Russell Collins
I have been thinking about best practices with Geronimo.  One of the things 
that I have been thinking about is the life of EJB's inside the EJB container.  
I am wondering if I should be setting used EJB's to null when I am done with 
them or should I just let the container handle it.  Example Code:



@Stateless
public class MyEJB implements IMyEJB
{

   @EJB(name=AnotherEJBLocal)
   private IAnotherEJBLocal m_anotherEJB;

  // Do some stuff with m_anotherEJB;

   protected void finalize()
   {
 m_anotherEJB = null;  //  Should I do this or let Geronimo handle it
}

}

Should I be including the finalizer code as I have it?  Should I just let 
Geronimo handle the life cycle?  Is there a different/better way to handle 
this?  Any philosophical insight would be greatly appreciated.  Thanks.


Russell Collins
Sr. Software Engineer
McLane Advanced Technology



CONFIDENTIALITY NOTICE: The information contained in this electronic mail 
(email) transmission (including attachments), is intended by MCLANE ADVANCED 
TECHNOLOGIES for the use of the named individual or entity to which it is 
addressed and may contain information that is privileged, confidential and/or 
protected as a trade secret. It is not intended for transmission to, or receipt 
by, any individual or entity other than the named addressee(s). If you have 
received this email in error, please delete it (including attachments) and any 
copies thereof without printing, copying or forwarding it, and notify the 
sender of the error by email reply immediately.