RFR: 8337517: Redacted Heap Dumps
    Chris Plummer 
    cjplummer at openjdk.org
       
    Wed Jul 31 23:33:31 UTC 2024
    
    
  
On Wed, 31 Jul 2024 19:10:41 GMT, Henry Lin <duke at openjdk.org> wrote:
> Adds a command line option `-redact` to `jcmd`, `redact` to `jmap` and `-XX:+HeapDumpRedacted` enabling redacted heap dumps. When enabled, the output binary heap dump has zeroes written out in place of the original primitive values in the object fields. There is a new jtreg test `heapDumpRedactedTest.java` that tests that the fields are properly redacted.
src/jdk.attach/linux/classes/sun/tools/attach/VirtualMachineImpl.java line 142:
> 140:      */
> 141:     InputStream execute(String cmd, Object ... args) throws AgentLoadException, IOException {
> 142:         assert args.length <= 4;                // includes null
I'm pretty sure we've been down this path before, and allowing 4 args will result in newer versions of the JVM not working with older versions of the tool. See [JDK-8219721](https://bugs.openjdk.org/browse/JDK-8219721)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20409#discussion_r1699202345
    
    
More information about the serviceability-dev
mailing list