Libraryless. Click here for Pure Java version (3991L/27K).
1 | // Note: On OpenJ9, the class HotSpotDiagnosticMXBean does not seem to exist. |
2 | |
3 | import javax.management.MBeanServer; |
4 | import java.lang.management.ManagementFactory; |
5 | |
6 | static void dumpHeap(File file) ctex { |
7 | MBeanServer server = ManagementFactory.getPlatformMBeanServer(); |
8 | virtual HotSpotDiagnosticMXBean bean = |
9 | ManagementFactory.newPlatformMXBeanProxy(server, |
10 | "com.sun.management:type=HotSpotDiagnostic", classForName("com.sun.management.HotSpotDiagnosticMXBean")); |
11 | file.delete(); |
12 | mkdirsForFile(file); |
13 | temp tempInfoBoxForever("Dumping heap..."); |
14 | long time = sysNow(); |
15 | call(bean, 'dumpHeap, f2s(file), true); |
16 | done2_always(time, "Done. " + fileInfo(file)); |
17 | } |
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1007491 |
Snippet name: | dumpHeap - dump heap to a file readable by jhat [HotSpot version] |
Eternal ID of this version: | #1007491/12 |
Text MD5: | 58d52204e35583144df432eb910ab5ff |
Transpilation MD5: | 4aca309870c35aac62ddeacc6afebd62 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-07-26 23:17:23 |
Source code size: | 695 bytes / 17 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 621 / 687 |
Version history: | 11 change(s) |
Referenced in: | [show references] |