Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 98179 invoked from network); 7 Dec 2004 19:29:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 7 Dec 2004 19:29:51 -0000 Received: (qmail 85514 invoked by uid 500); 7 Dec 2004 19:29:47 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 85434 invoked by uid 500); 7 Dec 2004 19:29:47 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 82898 invoked by uid 99); 7 Dec 2004 19:28:14 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) From: "Mat McGowan" To: Subject: [jelly] comment - memory leak from using ThreadLocal Date: Tue, 7 Dec 2004 20:28:17 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 Thread-Index: AcTckuaoWwFyIjL4TumXHCSO418gIQ== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Message-Id: X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N This is quite long so here's an overview: - couldn't get jelly CVS HEAD to work with maven 1.0.1 - from code inspection, seems there may still be a memory leak even with the fix, possibly because the tests don't exercise all tag types. After signing in to JIRA, I wanted to a comment to the JIRA issue JELLY-148, but was denied access, so I'll post it here. Recent comments requested that people try out the CVS HEAD containing the memory leak fix. Alas, I couldn't get the latest state to run: With latest jelly from CVS patched into maven 1.0.1, running maven multiproject fails with: [echo] Generating the Source Xref... maven-jxr-plugin:report: [echo] BUILD FAILED File...... E:\Documents and Settings\mat\.maven\cache\maven-multiproject-plugin- 1.3.1\plugin.jelly Element... maven:reactor Line...... 103 Column.... 9 Unable to obtain goal [site] -- E:\Documents and Settings\mat\.maven\cache\maven -jxr-plugin-1.4.2\plugin.jelly:94:55: Warning: Could not find file R:\stylesheet.css to copy. This problem doesn't occur with the original jelly jar included in the maven distribution. (The evaluation of the filename r:\stylesheet.css is incorrect - it should be several directories down.) I also tried with the CVS HEAD of jexl incase that was needed as well, but it made no difference. I also tried replacing the tag-libraries with the latest versions, but no change.) Anyway, I was also trying to diagnise the memory leak before I'd discovered a fix was already available. From what I saw, I also wonder if there is still exists a memory leak, although couldn't look at it fully because of the regression problem above. When profiling the older jelly code (pre WeakRefScript as found in maven 1.0.1), from the code, I was expecting all scripts that are being held from GC by ThreadLocal to be TagScript instances, but I also found some instances of other script types (StaticScript, TemplateScript). The only explanation I have is that TagScript.setTag is being called, which under current CVS HEAD _doesn't_ wrap the tag's script in a weak reference holder, so this may potentially still cause leaks? If I could get jelly running with maven, I would have changed TagScript.setTag to protected void setTag(Tag tag) { Script body = tag.getBody(); if (!(body instanceof WeakReferenceWrapperScript)) { tag.setBody(new WeakReferenceWrapperScript(body)); } tagHolder.set(tag); } to see if that helped. Appologies for the long post. Regards, Mat McGowan --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org