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

(bf) Allow users to bound the size of buffers cached in the per-thread buffer caches

    XMLWordPrintable

Details

    • b104
    • generic
    • generic

    Backports

      Description

        Some NIO channel operations use temporary DirectByteBuffers which are cached in thread-local caches to avoid having to allocate / free a buffer at every operation.

        Unfortunately, there is no bound imposed on the size of buffers added to the thread-local caches. So, infrequent channel operations that require a very large buffer can create a native memory leak.

        We should introduce a property, jdk.nio.MaxCachedBufferSize that if set sets a limit on the size of the buffers that can be added to the thread-local caches. Operations that require a buffer that is larger than this limit will allocate then free an one-off buffer.

        Attachments

          Issue Links

            Activity

              People

                tonyp Tony Printezis
                tonyp Tony Printezis
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: