[chef] Re: Tomcat Perm-Gen OutOfMemoryErrors and restarting


Chronological Thread 
  • From: Haselwanter Edmund < >
  • To:
  • Subject: [chef] Re: Tomcat Perm-Gen OutOfMemoryErrors and restarting
  • Date: Mon, 12 Sep 2011 15:09:31 +0200


On 12.09.2011, at 14:50, Edward Sargisson wrote:

> Hi all,
> There was a discussion weeks back about restarting Tomcat after every
> deploy to prevent PermGen OutOfMemoryErrors.

you can check the current amount of used memory and work from that.
I implemented that some time back with snmp:

https://github.com/opscode/cookbooks/blob/4d7698e5877c61f41692d89d6ca64c275a7fe895/tomcat6/libraries/tomcat_manager.rb

essentially requesting a restart of tomcat *before* deployment if the 
remaining PermGen size is not big enough:

        if ((perm_gen_max - perm_gen_used) < min_perm_gen) 
#node[:tomcat][:permgen_min_free_in_mb])
          Chef::Log.info "SNMP reported: PermGen 
Max:#{perm_gen_max/1024/1024} PermGen Used:#{perm_gen_used/1024/1024} , diff: 
#{(perm_gen_max/1024/1024 - perm_gen_used/1024/1024)}  is lower than 
#{min_perm_gen/1024/1024} "
          @new_resource.service.run_action(:restart)
          poll_manger_until_running
        end


> 
> It trigger a memory about what causes these so here are some resources:
> http://stackoverflow.com/questions/88235/how-to-deal-with-java-lang-outofmemoryerror-permgen-space-error
> http://www.jroller.com/agileanswers/entry/preventing_java_s_java_lang
> http://stufftohelpyouout.blogspot.com/2011/05/diagnosing-webappportlet-hot-deploy.html
> 
> I have no idea if these actually work but may help.
> 
> Cheers,
> Edward

--
DI Edmund Haselwanter, 
,
 http://edmund.haselwanter.com/
http://www.iteh.at ;| http://facebook.com/iTeh.solutions ;| 
http://at.linkedin.com/in/haselwanteredmund ;







Archive powered by MHonArc 2.6.16.

§