Forums de discussion

PermGen/memory leak issue

Dave Smith, modifié il y a 7 années.

PermGen/memory leak issue

New Member Publications: 7 Date d'inscription: 06/12/16 Publications récentes
Hi,

While deploying Grails portlets in our Liferay environment we're getting PermGen errors after a few deploys. We have our PermGen memory set to 512mb I believe. I'm also seeing the message below which might be the culprit.

[/test-portlet] appears to have started a thread named [MultiThreadedHttpConnectionManager cleanup] but has failed to stop it. This is very likely to create a memory leak

Any ideas on how to improve this issue?

Thanks!
thumbnail
David H Nebinger, modifié il y a 7 années.

RE: PermGen/memory leak issue (Réponse)

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
Actually if you're using Tomcat, it has a known issue where the classloader does not discard references appropriately during undeploy (or redeploy).

After a few hot deploys permgen fills and you get the OOM exception.

Likely you are suffering from something similar. The easiest resolution is to incorporate restarts into your deployment process.
Dave Smith, modifié il y a 7 années.

RE: PermGen/memory leak issue

New Member Publications: 7 Date d'inscription: 06/12/16 Publications récentes
Thank you for your answers. We currently do restart often. We have about 20 portlets, so every time we restart it takes about 5-10 minutes for everything to reload. It's crippling for development time. The Grails portlets take especially long to deploy since we're deploying the entire Grails framework for every one of them.

Do you have any recommendations on speeding up restarting?

Thanks.
thumbnail
Andrew Jardine, modifié il y a 7 années.

RE: PermGen/memory leak issue

Liferay Legend Publications: 2416 Date d'inscription: 22/12/10 Publications récentes
Hey Dave,

I'm not sure that you would get a HUGE performance gain, but you would realize SOME improvement if you try reducing the number of plugin projects you have. For example, you may find that 5 individual plugin projects (let's say portlets) can be collapsed into a single plugin. That alone would reduce the number of deployments from 20 - 15 which would not only speed up the deployment time, but also allow you to go longer between restarts. Personally, for my projects, I always start with just ONE plugin project per type and only break out the plugins into additional projects as necessary. For me this has been an effective way to ensure quick startup times (I have projects with 20, 30 portlet definitions but only one plugin project).

With that said, I am not using grails so I am not sure what you can do to help that. Depending on your version of Liferay, perhaps using Gradle as a build tool which intelligently only builds project items that have actually changed. And along that train of thought... 20 grails portlets build grails 20 times over, reduced to one or two grails portlet plugin projects would also mean X fewer grails builds emoticon

If you follow a common pattern (and naming convention) for your portlet development, it shouldn't take long to collapse the projects into a handful to try it out.
thumbnail
Andrew Jardine, modifié il y a 7 années.

RE: PermGen/memory leak issue (Réponse)

Liferay Legend Publications: 2416 Date d'inscription: 22/12/10 Publications récentes
100% inline with what David says -- and in fact a while back I found an article that I used to validate the issue. In case you are interested to dig a little deeper -- https://cdivilly.wordpress.com/2012/04/23/permgen-memory-leak/
vaibhav gawali, modifié il y a 7 années.

RE: PermGen/memory leak issue (Réponse)

Junior Member Publications: 25 Date d'inscription: 29/11/16 Publications récentes
Restart your server.