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 116186 - MIMEResolverImpl keeps its declaring xml text in memory
Summary: MIMEResolverImpl keeps its declaring xml text in memory
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: rmatous
URL:
Keywords: PERFORMANCE, SIMPLEFIX
Depends on:
Blocks:
 
Reported: 2007-09-20 16:27 UTC by Petr Nejedly
Modified: 2008-12-22 10:56 UTC (History)
1 user (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 Petr Nejedly 2007-09-20 16:27:28 UTC
MIMEResolverImpl, upon init, parses the xml file that specifies it, but keeps it in memory, probably as a result of
implementation detail of extending the XML handler.
The declaring text is reachable through the "locator" field of XMLMIMEComponent.
The redundant char arrays are easily found in a heap dump because of their size (usually 16400B) and reveal few other
unnecessary objects on the heap. Because the array is overallocated by the XML infrastructure and thanks to the number
of XML described MIME resolvers, this causes a waste of over 400KB for bull IDE.
Comment 1 Petr Nejedly 2007-10-30 18:39:52 UTC
Well, could you consider this very simple workaround for 6.0:
--- MIMEResolverImpl.java       16 Oct 2007 14:39:12 -0000      1.29
+++ MIMEResolverImpl.java       30 Oct 2007 17:38:37 -0000
@@ -390,6 +390,7 @@
                     component.endElement(namespaceURI, localName, qName);
                     if (componentDelimiter.equals(qName)) {
                         state = IN_RESOLVER;
+                        component.setDocumentLocator(null);
                     }
                     break;
             }

Thanks...
Comment 2 rmatous 2007-10-31 10:44:08 UTC
/cvs/core/src/org/netbeans/core/filesystems/MIMEResolverImpl.java,v  <--  MIMEResolverImpl.java
new revision: 1.30; previous revision: 1.29
Comment 3 Petr Nejedly 2007-12-04 16:19:11 UTC
verified