34 messages in org.codehaus.groovy.devRe: [groovy-dev] Re: [groovy-user] Me...
FromSent OnAttachments
Alex TkachmanOct 16, 2008 2:30 pm 
Alex TkachmanOct 16, 2008 3:17 pm 
Jochen TheodorouOct 16, 2008 3:49 pm 
Tim QuinnOct 16, 2008 4:15 pm 
Alexander VeitOct 16, 2008 4:34 pm 
Jochen TheodorouOct 16, 2008 4:43 pm 
Tim QuinnOct 16, 2008 5:28 pm 
Jochen TheodorouOct 17, 2008 6:35 am 
Alex TkachmanOct 17, 2008 6:44 am 
Graeme RocherOct 17, 2008 6:54 am 
Jochen TheodorouOct 17, 2008 7:05 am 
Graeme RocherOct 17, 2008 7:14 am 
alex...@gmail.comOct 17, 2008 7:30 am 
Jochen TheodorouOct 17, 2008 7:36 am 
Alex TkachmanOct 17, 2008 9:51 am 
Jochen TheodorouOct 22, 2008 5:27 am 
Alex TkachmanOct 22, 2008 5:37 am 
Jochen TheodorouOct 22, 2008 6:05 am 
Alex TkachmanOct 22, 2008 6:08 am 
Jochen TheodorouOct 22, 2008 6:18 am.zip
Alex TkachmanOct 22, 2008 6:32 am 
Jochen TheodorouOct 22, 2008 7:06 am 
Guillaume LaforgeOct 22, 2008 7:08 am 
Alex TkachmanOct 22, 2008 7:11 am 
Guillaume LaforgeOct 22, 2008 7:21 am 
Jochen TheodorouOct 22, 2008 7:22 am 
Jochen TheodorouOct 22, 2008 7:39 am 
Jochen TheodorouOct 22, 2008 7:41 am 
Alex TkachmanOct 22, 2008 9:16 am 
Jochen TheodorouOct 22, 2008 10:11 am 
Jochen TheodorouOct 22, 2008 11:24 am 
Alex TkachmanOct 22, 2008 11:48 am 
Jochen TheodorouOct 22, 2008 2:07 pm 
Jochen TheodorouDec 22, 2008 12:52 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [groovy-dev] Re: [groovy-user] Memory leaks in GroovyActions...
From:alex...@gmail.com (alex@gmail.com)
Date:Oct 17, 2008 7:30:39 am
List:org.codehaus.groovy.dev

Did you notice setContextClassLoader(null)

On 10/17/08, Jochen Theodorou <blac@gmx.org> wrote:

Alex Tkachman schrieb:

Jochen, Graeme,

Could you please review fix I just commited. It is based on reference counters (not special API or profiles). Unfortunately I don't have (easy) way to test it, so review is very important

hmm... I am not sure this will really fix the problem... the problem was a OOME because the loader could not be garbage collected, because there is still an active thread. Assuming the thread does stop 5s after the last use and another deploy would not have enough memory left, but is done within these 5s, then we still get the OOME. If things are bad and there are multiple deploys in that time the story gets even worse. If multiple aplication are in the server and they use groovy then you have that problem multiple times.

Also I am not too sure about the reference counting you do. If there are still entries, then the loader can not be garbage collected, because oif the Thread. On the other hand if there where entries and no thread, then the loader and all classes could be garbage collected right away. So the garbage collector would have to do multiple passes and then the Thread still waits for 5s and I think in the meantime the OMMe is already there. So at last we need to decrement first and leave the thread right away if it reaches 0. But I still think that would not be enough, because that code would be executed after the garbage collector was not able to free enough space.

We will still get the OOME.

I think neither the reference count nor the timeout will work in general. There is a small chance it will do for the glassfish people if they are not fast enough... but the more groovy applications are running and are redeployed the higher the chance for a OOME, because the 5s are not past yet

bye blackdrag