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

Add option to jcmd to overwrite a heap dump or stream to special files

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 11, 16, 17
    • Fix Version/s: None
    • Component/s: core-svc
    • Labels:

      Description

      Currently you cannot overwrite an already existing heap dump with jcmd GC.heap_dump, neither can you write to named pipes (Windows) or domain sockets or similar devices (Unix).

      The enhancement proposes to add two additional switches to the GC.heap_dump diagnostic command which would enable both use cases:
      - an '-overwrite' flag would allow the user to overwrite (using truncation) an already existing heap dump; if the specified file is not already present, it would be created as without the flag.
      - a '-stream' flag would allow to write to special files like pipes, domain sockets or ttys; the file will not be truncated and if it is not already present, an error will be reported instead of creating it.

      Note that we would not check if the file argument to '-stream' is really a special file or that the argument to '-overwrite' isn't a special file.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rschmelter Ralf Schmelter
              Reporter:
              rschmelter Ralf Schmelter
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: