You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by ApolloX <sc...@selikoff.net> on 2008/03/20 01:24:17 UTC

Tracking Down Memory Leaks in G1.2

I've noticed in most versions of Geronimo there appear to be memory leaks. 
For example, if I use the Hot Deployer to redeploy an EAR multiple times a
time on a development server, it often leads to OutOfMemory exceptions
regardless of how much the EAR is actually used.  In more general
environments, though, the server slowly accumulates memory until it requires
a restart every few days (or sooner).

I'm trying to address these issues by writing code that actively flushes any
static application objects and runs garbage collection after, but I haven't
had much success in decreasing memory over time.  Can someone provide me
with code that I can use to flush the EJB container cache?  If I can
actively flush that cache, at least I can rule out it for potential memory
leaks.

I'm using openejb+tranql+mysql, but my understanding is that the cache is
owned by openejb.  I've tried determining how to flush the EJB CMP2 cache
but I have yet to locate source code for openejb 2.2.   Anyone have any code
(or suggestions) for how to flush the CMP2 cache? 
-- 
View this message in context: http://www.nabble.com/Tracking-Down-Memory-Leaks-in-G1.2-tp16168531s134p16168531.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: Tracking Down Memory Leaks in G1.2

Posted by ApolloX <sc...@selikoff.net>.
That's great but it doesn't answer my more basic question... how do I
explicitly flush the persistence layer cache for CMP2 beans in G1.X?
-- 
View this message in context: http://www.nabble.com/Tracking-Down-Memory-Leaks-in-G1.2-tp16168531s134p16231950.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: Tracking Down Memory Leaks in G1.2

Posted by Kevan Miller <ke...@gmail.com>.
On Mar 19, 2008, at 8:24 PM, ApolloX wrote:

>
> I've noticed in most versions of Geronimo there appear to be memory  
> leaks.
> For example, if I use the Hot Deployer to redeploy an EAR multiple  
> times a
> time on a development server, it often leads to OutOfMemory exceptions
> regardless of how much the EAR is actually used.  In more general
> environments, though, the server slowly accumulates memory until it  
> requires
> a restart every few days (or sooner).
>
> I'm trying to address these issues by writing code that actively  
> flushes any
> static application objects and runs garbage collection after, but I  
> haven't
> had much success in decreasing memory over time.  Can someone  
> provide me
> with code that I can use to flush the EJB container cache?  If I can
> actively flush that cache, at least I can rule out it for potential  
> memory
> leaks.
>
> I'm using openejb+tranql+mysql, but my understanding is that the  
> cache is
> owned by openejb.  I've tried determining how to flush the EJB CMP2  
> cache
> but I have yet to locate source code for openejb 2.2.   Anyone have  
> any code
> (or suggestions) for how to flush the CMP2 cache?

OpenEJB 2.2 source is here -- https://svn.apache.org/repos/asf/incubator/openejb/tags/openejb-2.2

Do you have evidence that an OpenEJB cache is the cause of your  
problem? If not, I'd suggest you use a profiler (e.g. JProfiler or  
YourKit) to analyze your memory growth. I like to use the '-XX: 
+HeapDumpOnOutOfMemoryError'  JRE option and analyze the resultant  
heapdump...

If you're seeing these OOME problems on 2.0 or 2.1, let me know and  
I'll have a look... IIRC, I tested deploy/undeploy on 2.0 and we were  
clean. It's easy for problems to sneak back in, however...

--kevan