You can use the jmap command:
jmap [option] (for connecting to a running process)
jmap [option] (for connecting to the main file)
jmap [option] [server_id @] (to connect to a remote debug server)
where the parameters are as follows:
-heap: print java summary
-permstat: for printing permanent generation statistics
Avnish kumar singh
source share