user1293081
user1293081

Reputation: 331

Memory leak on a Liferay portlet

I'm currently trying to figure out a memory leak on a Liferay portal (6.0.6) running on Tomcat 6.0.26. We've been looking through the memory dumps generated when OutOfMemoryException occurs and there is a very clear abnormality. One to three ThreadWithAttributes are having one String / char array each taking up over 1GB in memory. It's contents is in the form of "10970_LAYOUT_56_INSTANCE_1GnU=ADddfj6O, 536133_LAYOUT_49=J23g02gH"... repeated over and over.

As I understand this is some kind of portlet-id and it's instance id, but how can I use this information to find out what porlet is causing this? I'm basically totally new to Liferay and webapps in general, although have an ok background with regular Java SE applications. As I understand Tomcat is using a Thread pool that demands portlets cleaning up after them selves, but we have a such large amount of portlets that it's really hard to guess the one(s) responsible. So, is there a way to pinpoint a portlet using that String ?

Thanks in advance

Upvotes: 1

Views: 1932

Answers (2)

Faisal Masood
Faisal Masood

Reputation: 291

Please see PortletInstanceFactoryImpl.java. This holds the hashmap which holds all the portlets. The "10970_LAYOUT_56_INSTANCE_1GnU=ADddfj6O" is portlet instance id. Issue with liferay as this hashmaps is not getting cleaned.

Upvotes: 1

mod
mod

Reputation: 383

Read this before trying out below mentioned line in all your portlets...

        String portletId = (String) request.getAttribute(WebKeys.PORTLET_ID);

Upvotes: 1

Related Questions