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

Avoid reallocation in java.base/unix/classes/java/lang/ProcessImpl.java

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core-libs
    • Subcomponent:
    • OS:
      linux, os_x, solaris, aix

      Description

      When draining stdout/stderr, the remaining bytes are copied into an array, and then the out/err stream is replaced with ByteArrayInputStream().

      In a case when a fewer number of bytes were read then the Stream.available() suggested, the array is reallocated with Arrays.copyOf().

      It is possible to avoid reallocation, and use three-args ByteArrayInputStream() constructor to specify a portion of the array used.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                igerasim Ivan Gerasimov
                Reporter:
                igerasim Ivan Gerasimov
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: