Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 339191 - Cleanup failure (memory leak?) while stopping WebViewerExample
Summary: Cleanup failure (memory leak?) while stopping WebViewerExample
Status: RESOLVED NOT_ECLIPSE
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.6.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.7.0   Edit
Assignee: Birt-ReportViewer CLA
QA Contact: Xiaoying Gu CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-08 05:08 EST by Jan Inowolski CLA
Modified: 2011-05-26 13:32 EDT (History)
2 users (show)

See Also:


Attachments
Report used to reproduce this issue (185.06 KB, application/octet-stream)
2011-03-16 03:45 EDT, Jan Inowolski CLA
no flags Details
catalina.out (13.63 KB, application/octet-stream)
2011-03-16 05:43 EDT, Xiaoying Gu CLA
no flags Details
catalina.out from PLD linux distribution (12.37 KB, application/octet-stream)
2011-03-16 06:41 EDT, Jan Inowolski CLA
no flags Details
catalina.out from Ubuntu (15.14 KB, application/octet-stream)
2011-03-16 06:51 EDT, Jan Inowolski CLA
no flags Details
memory snapshot (74.93 KB, image/png)
2011-04-19 03:21 EDT, Jun Ouyang CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Inowolski CLA 2011-03-08 05:08:49 EST
When stopping WebViewerExample in Tomcat 6 these entries appear in the catalina.out log:

SEVERE: The web application [/WebViewerExample] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@7d813672]) and a value of type [com.ibm.icu.impl.ResourceBundleWrapper] (value [com.ibm.icu.impl.ResourceBundleWrapper@2e1db6bd]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Mar 8, 2011 10:29:28 AM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/WebViewerExample] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@20c849f2]) and a value of type [org.eclipse.birt.report.context.BirtContext] (value [org.eclipse.birt.report.context.BirtContext@3d6ebfae]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Mar 8, 2011 10:29:28 AM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/WebViewerExample] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@31ea5804]) and a value of type [com.ibm.icu.util.ULocale] (value [en_US]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Mar 8, 2011 10:29:28 AM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/WebViewerExample] created a ThreadLocal with key of type [org.apache.axis.utils.XMLUtils.ThreadLocalDocumentBuilder] (value [org.apache.axis.utils.XMLUtils$ThreadLocalDocumentBuilder@6f76998b]) and a value of type [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl] (value [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl@535aadd8]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.


Steps:
1. Put WebViewerExample (2.6.2) into webapps dir. Commons-logging goes into WEB-INF/lib,
2. Startup Tomcat,
3. Generate some reports (I've generated my simple test report without even database connection use),
4. Stop WebViewerExample in Tomcat Manager.


Generally, I have a PermGen issue with my own servlet using BIRT - it hangs up with out of PermGen memory after sth about 700 requests (maxPermSize is 256m). The above is one of the issues I've found while trying to find cause of my problem.
Comment 2 Xiaoying Gu CLA 2011-03-16 03:26:34 EDT
I can not reproduce this issue with birt 2.6.2 release.

My environment was:
Windows 7 + JDK 1.6 + new installed Tomcat 6.0 + WebViewerExample 2.6.2 release.
No other application was installed on tomcat.

Stop WebViewerExample in the Tomcat Manage console works fine. Check the catalina.out, there is no error message as you listed in the bug description.
Comment 3 Jan Inowolski CLA 2011-03-16 03:45:34 EDT
Created attachment 191280 [details]
Report used to reproduce this issue

Heve you tried with linux? And my "simple" report has also a bit javascript code within.
Comment 4 Xiaoying Gu CLA 2011-03-16 03:54:01 EDT
(In reply to comment #3)
> Created attachment 191280 [details]
> Report used to reproduce this issue
> 
> Heve you tried with linux? And my "simple" report has also a bit javascript
> code within.

Would you please attach your sample report?
Comment 5 Jan Inowolski CLA 2011-03-16 05:19:55 EDT
Look above :-)
Comment 6 Xiaoying Gu CLA 2011-03-16 05:43:38 EDT
Created attachment 191292 [details]
catalina.out

Hi,

I tried with the report you attached on Tomcat 6.0 + AS4 + jdk 1.5.0, the error still can not be reproduced. The catalina.out was attached.
Comment 7 Jan Inowolski CLA 2011-03-16 06:41:41 EDT
Created attachment 191294 [details]
catalina.out from PLD linux distribution
Comment 8 Jan Inowolski CLA 2011-03-16 06:51:38 EDT
Created attachment 191296 [details]
catalina.out from Ubuntu

Here is copy of my test tomcat with birt (uses port 18888, manager login/pass: admin/admin). 
http://usosphp.mimuw.edu.pl/~jankiel/pub/tomcat_339191.tgz

If you weren't repoduced this whith (almost) exactly the same configuration, then maybe it would be JVM related thing? I've no further ideas now...

For both PLD and Ubuntu - this is my 'java -version' output:
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) Server VM (build 19.1-b02, mixed mode)
Comment 9 Xiaoying Gu CLA 2011-03-18 04:31:24 EDT
I can reproduce this issue with Tomcat 6.0.32 release. It doesn't related to Linux version or jdk version.
Comment 10 Jun Ouyang CLA 2011-04-19 03:18:23 EDT
1. Memory leak could not be reproduced on Tomcat 6.0.32 release + birt 262 release.

Java settings:JAVA_OPTS=-Xms1024m -Xmx1024m -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError

Test scenario:

1. Use the report attached
2. Do transient viewing repeatedly

  After sent more than 10K transient viewing requests, the perm gen space only used 56MB memory, no memory leak was found.

  The snapshot attached show the VM status after 10K transient viewing requests completed. 

2. The memory leak warning is actually the "Custom ThreadLocal class type leak" of Tomcat, which was fixed in tomcat 7.0.6. See http://wiki.apache.org/tomcat/MemoryLeakProtection#cclThreadSpawnedByWebApp
Comment 11 Jun Ouyang CLA 2011-04-19 03:21:30 EDT
Created attachment 193547 [details]
memory snapshot
Comment 12 Jun Ouyang CLA 2011-04-19 03:22:34 EDT
Resolve as NOT_ECLIPSE.
Comment 13 Xiaoying Gu CLA 2011-04-25 05:58:34 EDT
Tried with Tomcat 7.0.6 and 7.0.12, the error message still can be reproduced with BIRT 2.6.2 release.

Reopen for further investigation.
Comment 14 Jun Ouyang CLA 2011-05-10 03:30:15 EDT
Through the document says this issue was fixed since tomcat 7.0.6, it still exists in 7.0.12. This can be confirmed by the "Custom ThreadLocal class" case mentioned in the document.

Resolve as NOT_ECLIPSE because it's actually a tomcat bug, whether it's fixed or not.
Comment 15 Xiaoying Gu CLA 2011-05-11 22:23:21 EDT
Verified.