This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 125079 - memory leak in JspParserImpl
Summary: memory leak in JspParserImpl
Status: RESOLVED DUPLICATE of bug 85817
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP Parser (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Tomas Mysik
URL:
Keywords: PERFORMANCE
Depends on:
Blocks: 123530
  Show dependency tree
 
Reported: 2008-01-11 01:42 UTC by Quy Nguyen
Modified: 2008-01-24 17:25 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Quy Nguyen 2008-01-11 01:42:26 UTC
The org.netbeans.modules.web.jspparser.JspParserImpl class causes a memory leak of WebProject objects.  It contains the
code:

    private synchronized WebAppParseProxy getParseProxy(WebModule wm) {
        JspParserImpl.WAParseSupportKey key = new JspParserImpl.WAParseSupportKey(wm);
        WebAppParseProxy pp = parseSupports.get(key);
        if (pp == null) {
            pp = createParseProxy(wm);
            parseSupports.put(key, pp);
        }
        return pp;
    }

However, there are no corresponding 'parseSupports.remove()' calls.  Since the JspParserImpl instance is held in the
JspParserFactory.parser static field, these entries are never garbage-collected.
Comment 1 Petr Jiricka 2008-01-11 08:14:48 UTC
Hi Quy, how big is the leak and when does it happen? Without this we can not say how serious this bug is a what should
be the priority.

Assigning to Tomas as he will be looking at the JSP parser performance/memory problems.
Comment 2 Quy Nguyen 2008-01-11 18:28:36 UTC
It at least happens every time a visual web project (or a page within that project) is opened.  I am not sure if it
occurs as regularly with plain web projects.  As for the severity of the leak, see:
http://wiki.netbeans.org/wiki/view/DevFaqMemoryLeaks

It specifically mentions Project instances as serious memory leaks.  In this case, every WebProject object is retained
in memory (so opening 5 web projects retains all 5 corresponding WebProject objects).  Therefore, I think P2 is the
correct priority with this issue.
Comment 3 Tomas Mysik 2008-01-14 13:32:50 UTC
JSPParser should be rewritten in NB 6.1.
Comment 4 Tomas Mysik 2008-01-24 17:25:36 UTC

*** This issue has been marked as a duplicate of 85817 ***