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

GC is not aware of native memory when creating GZIPOutputStream

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: tbd
    • Component/s: core-libs
    • Labels:

      Description

      I have identified an issue with GZIPOutputStream.
      For each instance of GZIPOutputStream, the zlib allocates about 250kb of native memory buffers.
      This memory is not trackable by any java tools (e.g. NMT) and it's freed once GZIPOutputStream object is destroyed.
      GC is not aware of that native memory as well.
      So this can lead to the following situation:
      lots of small (small in java heap) GZIPOutputStream objects doesn't produce any pressure on GC, hence GC is not in hurry to clean them up. but due to native memory allocations in zlib the system is having issues doing new native memory allocations resulting in OOM crashes of java.
      The workaround is explicit GC (for example using jcmd).
      So far I can't see any easy solution to that issue.

        Attachments

          Activity

            People

            Assignee:
            lancea Lance Andersen
            Reporter:
            vkempik Vladimir Kempik
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: