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

Avoid dynamic memory in AsyncLogWriter

XMLWordPrintable

    • b16
    • generic
    • generic

      Currently, there are 2 sources of dynamic allocations.
      1. pointer-based linked-list
      2. 'strdup' message contents

      I don't think this has memory leak, but this has impact on glibc/malloc.
      If allocation of logsites interleaves with other allocation, it is hard to clean up all glibc arenas. This worsens fragmentation issue.

      I plan to use pre-allocated buffer and serialize the linked-list to it. This effort won't eliminate mutex lock. I plan to use ping-pong buffers to guarantee AsyncLogWriter is non-blocking.

            xliu Xin Liu
            xliu Xin Liu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: