You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2018/07/05 06:14:07 UTC

[karaf] branch karaf-4.1.x updated: [KARAF-5796] Use .hprof extension for heap dump

This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch karaf-4.1.x
in repository https://gitbox.apache.org/repos/asf/karaf.git


The following commit(s) were added to refs/heads/karaf-4.1.x by this push:
     new fc897ba  [KARAF-5796] Use .hprof extension for heap dump
fc897ba is described below

commit fc897bacd6de8d54a0ff636bbd5e95396f8486a5
Author: Matt Pavlovich <ma...@hyte.io>
AuthorDate: Thu Jun 28 16:56:12 2018 -0500

    [KARAF-5796] Use .hprof extension for heap dump
---
 .../org/apache/karaf/diagnostic/core/providers/HeapDumpProvider.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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 cff6bfa..1675c53 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 class HeapDumpProvider implements DumpProvider {
             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 class HeapDumpProvider implements DumpProvider {
 
             // 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)) {