Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6927240

Memory leak in pack200 implementation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • 7
    • 6u18
    • deploy
    • None

      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).

            ngthomas Thomas Ng (Inactive)
            dlipin Dmitry Lipin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: