Hi,
Is it possible in some way to get a value from a java.nio.DirectByteBuffer if I have address and offset that I would like to look at, in memory snapshot? Or hprof snapshot? Or in some other way?
Generally what Unsafe.getInt(address) is doing. Is in any way possible to get the value using the snapshot as well?
Regards,
Pavol
Getting value from a NIO direct buffer
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: Getting value from a NIO direct buffer
Hello Pavol,
Unfortunately, native memory content is not available in a memory snapshot, neither .snapshot nor .hprof.
Best regards,
Anton
Unfortunately, native memory content is not available in a memory snapshot, neither .snapshot nor .hprof.
Best regards,
Anton
-
- Posts: 6
- Joined: Thu Nov 22, 2007 8:43 am
Re: Getting value from a NIO direct buffer
Any chance of adding such feature to the agent and yourkit? However, not sure how much it would/could be used.
In mean time, I was able to get the value based on the memory address I found in memory snapshot and then using dd to get the value from the process memory as described here:
https://unix.stackexchange.com/question ... ng-command
In mean time, I was able to get the value based on the memory address I found in memory snapshot and then using dd to get the value from the process memory as described here:
https://unix.stackexchange.com/question ... ng-command
-
- Posts: 6
- Joined: Thu Nov 22, 2007 8:43 am
Re: Getting value from a NIO direct buffer
It was something like this:
I just needed to confirm the value on the address is -1. If it wouldn't be, I would have to investigate the bug that was happening in some other direction.
Code: Select all
sudo dd bs=1 skip="$((0x7F8FB21BA011))" count=4 if="/proc/4341/mem" | od -An -vtd4
dd: ‘/proc/4341/mem’: cannot skip to specified offset
4+0 records in
4+0 records out
4 bytes (4 B) copied, 5.9129e-05 s, 67.6 kB/s
-1
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: Getting value from a NIO direct buffer
Hi Pavol,
Best regards,
Anton
We have added corresponding feature request.Any chance of adding such feature to the agent and yourkit? However, not sure how much it would/could be used.
Interesting approach, thank you for sharing. Unfortunately it works only while the process is still alive and is not applicable after it has terminated.I was able to get the value based on the memory address I found in memory snapshot
Best regards,
Anton