Created
September 3, 2014 14:54
-
-
Save bugs84/514cd38ccd480305de1a to your computer and use it in GitHub Desktop.
OQL how to write bytes in heapdump into file in VisualVM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//To get Id of object | |
//In VisualVM right click on instance of byte[] and select 'Copy ID' | |
var bytes = heap.findObject(0xe21b95d8); | |
var filePath = "c:/tmp/result.txt" | |
var fos = new java.io.FileOutputStream(filePath); | |
var len = bytes.length | |
for (var i=0; i<len; i++) { | |
fos.write(bytes[i]); | |
} | |
fos.close(); | |
"Bytes has been written into file '" + filePath+"'"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment