karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Moquin <fragility...@gmail.com>
Subject Re: karaf PermGen space problem
Date Wed, 12 Mar 2014 17:21:39 GMT
JDK 8 is supposed to have made improvements to these types of issues (class
unloading is turned on automatically) and I believe it has a permgen area
anymore.

If you turn on classunloading in the jvm (mentioned above), the classes
should all get unloaded, unless there are classes "leaking" due to static
references on each other which prevent them from being unloaded when the
classloader is destroyed.

Also, keep in mind, in production you won't be hot deploying at the
frequency you are doing in development.  You could also try to isolate your
bundles from the thirdparty one to prevent it from being reloaded (unless
it needs upgraded).. that should also prevent the issue.  You should be
able to search on ways to update your bundle without causing another bundle
to reload unless necessary.

Ryan
On Mar 11, 2014 7:07 PM, "Jeremy Jongsma" <jeremy@barchart.com> wrote:

> For us the cause was frequently third party libraries doing silly things
> like starting non-daemon threads in static scope that cannot be shut down,
> which keeps references to the old classloader. So every time that bundle is
> replaced the PermGen climbs and can never be reclaimed.
>
> Among others, the AWS SDK was a big culprit in our apps. After spending
> days in the heap analyzer trying to track everything down I finally said
> screw it, and now we're back to forcing a full restart w/ cache wipe when
> we deploy code updates.
>
> I don't think that hot-deployment is worth the time it will take you
> unless you don't use any third party code, and even then you will regularly
> spend hours in the profiler trying to figure out what's hanging onto the
> old classloader with the latest code update.
>
>
> On Tue, Mar 11, 2014 at 1:46 PM, Guillaume Nodet <gnodet@apache.org>wrote:
>
>> This could also be caused by bad bundles that don't clean things
>> correctly when stopped.
>>
>>
>> 2014-03-11 19:21 GMT+01:00 Henryk Konsek <hekonsek@gmail.com>:
>>
>> Hi,
>>>
>>> > If
>>> > this issue exists, can we not be safe in planning to do updates like
>>> that?
>>>
>>> Oracle JVM keeps classes forever until instructed otherwise. Try to
>>> enable garbage collector on PermGen memory space.
>>>
>>> -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled
>>> -XX:+CMSClassUnloadingEnabled
>>>
>>> Cheers.
>>>
>>> --
>>> Henryk Konsek
>>> http://henryk-konsek.blogspot.com
>>>
>>
>>
>

Mime
View raw message