1

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

user1293081
  • 331
  • 1
  • 3
  • 12
  • You may see some of the portlet id's in the generated html source in the browser. since some information has to do a roundtrip it must be somewhere. I can recommend using JProfiler or Yourkit to detect memory leaks. Sometimes the JS polling the browser whos user was logged out after a restart causes endless session-recreation. – wemu Sep 20 '12 at 10:07

2 Answers2

1

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

        String portletId = (String) request.getAttribute(WebKeys.PORTLET_ID);
Community
  • 1
  • 1
mod
  • 383
  • 5
  • 22
1

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.

Faisal Masood
  • 271
  • 1
  • 3
  • 7