Skip to content

Commit a48f385

Browse files
committed
File creation for dump changed
1 parent f83b126 commit a48f385

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎core-java/src/main/java/com/baeldung/heapdump/HeapDump.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
import com.sun.management.HotSpotDiagnosticMXBean;
44

55
import javax.management.MBeanServer;
6+
67
import java.io.IOException;
78
import java.lang.management.ManagementFactory;
9+
import java.nio.file.Paths;
810

911
public class HeapDump {
1012

@@ -16,7 +18,7 @@ public static void dumpHeap(String filePath, boolean live) throws IOException {
1618
}
1719

1820
public static void main(String[] args) throws IOException {
19-
final String file = "/tmp/dump.hprof";
21+
String file = Paths.get("dump.hprof").toFile().getPath();
2022

2123
dumpHeap(file, true);
2224
}

0 commit comments

Comments
 (0)