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

Logging: Fix extremely small line buffer size

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 13
    • Fix Version/s: tbd
    • Component/s: hotspot
    • Labels:

      Description

      In logStream.hpp, the _smallbuf member is 64 chars long. If I am not misunderstanding the code, this will create malloc-free calls for almost each and every LogStream. Would be nice to align this size to vwrite_buffer_size (512) in logTagSet.cpp.

      Also update the bad comments regarding stack allocation (they are always stack allocated):
        // Helper class, maintains the line buffer. For small line lengths,
        // we avoid malloc and use a fixed sized member char array. If LogStream
        // is allocated on the stack, this means small lines are assembled
        // directly on the stack.

      .
      .
      .

        // Prevent operator new for LogStream.
        static void* operator new (size_t);
        static void* operator new[] (size_t);

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              lkorinth Leo Korinth
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: