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

Rework EventLog message string handling

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 13
    • Fix Version/s: 14
    • Component/s: hotspot

      Description

      The Eventlog system keeps an array of events which almost completely consist of variable sized string messages.

      The message buffer consists of fixed-sized records with a fixed-sized char array for those messages. This is not a good fit. Mostly, those buffers are too large and we waste space. Then, occasionally a message is too large and we truncate. To avoid truncation, stopgap solutions have been added in the past (e.g. JDK-8204551) which would just increase the array size, therefore avoiding truncation (for now) but increasing memory waste.

      A better solution would be to hold the strings in var-length buffers. We do not want strdup since that is too expensive and events may be written in situations where C heap is flaky.

      So I developed a solution where the strings live outside the event records in a FIFO buffer of variable length strings - each string just uses exactly as much memory as needed, and truncation is not a problem anymore. This allows us also to increase the number of event records held.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                stuefe Thomas Stuefe
                Reporter:
                stuefe Thomas Stuefe
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: