[ https://issues.apache.org/jira/browse/KARAF-5796?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16533297#comment-16533297 ]
ASF GitHub Bot commented on KARAF-5796: --------------------------------------- jbonofre closed pull request #536: [KARAF-5796] Heap dump needs to end in .hprof w/ newer JDK (4.1.6-SNAPSHOT) URL: https://github.com/apache/karaf/pull/536 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/diagnostic/boot/src/main/java/org/apache/karaf/diagnostic/core/providers/HeapDumpProvider.java b/diagnostic/boot/src/main/java/org/apache/karaf/diagnostic/core/providers/HeapDumpProvider.java index cff6bfa2a8..1675c53245 100644 --- a/diagnostic/boot/src/main/java/org/apache/karaf/diagnostic/core/providers/HeapDumpProvider.java +++ b/diagnostic/boot/src/main/java/org/apache/karaf/diagnostic/core/providers/HeapDumpProvider.java @@ -41,7 +41,7 @@ public void createDump(DumpDestination destination) throws Exception { Object diagnosticMXBean = ManagementFactory.newPlatformMXBeanProxy(mBeanServer, "com.sun.management:type=HotSpotDiagnostic", diagnosticMXBeanClass); - heapDumpFile = File.createTempFile("heapdump", ".txt"); + heapDumpFile = File.createTempFile("heapdump", ".hprof"); heapDumpFile.delete(); Method method = diagnosticMXBeanClass.getMethod("dumpHeap", String.class, boolean.class); @@ -49,7 +49,7 @@ public void createDump(DumpDestination destination) throws Exception { // copy the dump in the destination in = new FileInputStream(heapDumpFile); - out = destination.add("heapdump.txt"); + out = destination.add("heapdump.hprof"); byte[] buffer = new byte[2048]; int l; while (((l = in.read(buffer)) != -1)) { ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Heap dump needs to end in .hprof w/ newer JDK > --------------------------------------------- > > Key: KARAF-5796 > URL: https://issues.apache.org/jira/browse/KARAF-5796 > Project: Karaf > Issue Type: Improvement > Components: karaf-core > Affects Versions: 4.1.5 > Reporter: Matt Pavlovich > Assignee: Jean-Baptiste Onofré > Priority: Major > Fix For: 4.1.6, 4.2.1 > > Attachments: Screen Shot 2018-06-28 at 4.12.16 PM.png, Screen Shot > 2018-06-28 at 4.12.36 PM.png > > > When running karaf> dump-create, the heap dump is not included. > Invoking the HotSpotDiagnostic MXBean directly results in an error message > indicating that the operation requires the file extension to end in ".hprof" > OS: OSX (10.13.5) > Java VM: 1.8.0_162 -- This message was sent by Atlassian JIRA (v7.6.3#76005)