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

sun.nio.cs.ext charsets don't release memory, even if soft referenced by cache

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 7
    • core-libs

      FULL PRODUCT VERSION :
      all

      ADDITIONAL OS VERSION INFORMATION :
      not important

      A DESCRIPTION OF THE PROBLEM :
      Map-based double byte charset in package sun.nio.cs.ext hold their mapping data in static class member variable. Since once an instance was loaded, it is held in cache of AbstractCharsetProvider by SoftReference. If SoftReference clears it's referent, it's static class member variables are held in memory.

      As these mapping can have big size, releasing the SoftReference of an unused charset doesn't have notable effect.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Charsets should hold their data as non final member variable, so if released, memory would be freed actually.


      REPRODUCIBILITY :
      This bug can be reproduced always.

            sherman Xueming Shen
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: