JDK-8240989 : convert clhsdb "dumpheap" command from javascript to java
  • Type: Sub-task
  • Component: hotspot
  • Sub-Component: svc-agent
  • Affected Version: 15
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-03-13
  • Updated: 2020-04-15
  • Resolved: 2020-04-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 15
15 b18Fixed
Description
In sa.js dumpheap is implemented as:

    registerCommand("dumpheap", "dumpheap [ file ]", "dumpHeap");

The 3rd argument is the implementation. In this case it is a java method in JSJavaScriptEngine.java, which does the following:

    public Object dumpHeap(Object[] args) {
        String fileName = "heap.bin";
        if (args.length > 0) {
            fileName = args[0].toString();
        }
        return new JMap().writeHeapHprofBin(fileName)? Boolean.TRUE: Boolean.FALSE;
    } 

So this java code is easily moved to CommandProcessor.java
Comments
URL: https://hg.openjdk.java.net/jdk/jdk/rev/fcc006f0d42f User: cjplummer Date: 2020-04-03 19:59:49 +0000
03-04-2020