Java Memory

Table of contents
  1. Runtime Data Area
  2. jmap
    1. Example usage
    2. Errors

Runtime Data Area

To be added


jmap

jmap is a CLI tool used to get memory-related information of a JVM.

Example usage

jmap -heap $PID

Errors

If you get the following error,

Can't attach to the process: ptrace(PTRACE_ATTACH, ..) failed for $PID: Operation not permitted

Try the following,

echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope

If you get the following error,

cannot open binary file

Make sure you are running the command as the same user that started the JVM.