JDK-6927240 : Memory leak in pack200 implementation
  • Type: Bug
  • Component: deploy
  • Sub-Component: deployment_toolkit
  • Affected Version: 6u18
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2010-02-17
  • Updated: 2011-01-19
  • Resolved: 2010-06-04
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7Resolved
Related Reports
Duplicate :  
Relates :  
Description
Current implementation of java.util.jar.Pack200.Packer (com.sun.java.util.jar.pack.*) contains memory leak.
Heap dump shows that a number of ConstantPool.$*Entry entries are not GCed.
Looking through the sources it is clear that a number of HashMaps, defined in ConstantPool (utf8Entries, classEntries, literalEntries, signatureEntries, etc) are never cleaned explicitely nor by GC after .pack() method been invoked. Subsequent usage of Packer for a large number of different jars result in PermGen gets exhausted. Using Pack200.newPacker() for each jar does not have any effect in comparison to using one instance of packer for all.

Workaround: run pack200 as the external process (${java.home}/bin/pack200).

Comments
WORK AROUND invoke/exec pack200.exe which is a standalone app. (pack200.exe does invoke a new vm. However unpack200.exe does not. )
17-02-2010