1

like the jstack command has -l option, which contains lock information.

    Usage:
    jstack [-l] <pid>
        (to connect to running process)
    jstack -F [-m] [-l] <pid>
        (to connect to a hung process)
    jstack [-m] [-l] <executable> <core>
        (to connect to a core file)
    jstack [-m] [-l] [server_id@]<remote server IP or hostname>
        (to connect to a remote debug server)

Options:
    -F  to force a thread dump. Use when jstack <pid> does not respond (process is hung)
    -m  to print both java and native frames (mixed mode)
    -l  long listing. Prints additional information about locks
    -h or -help to print this help message

I am wondering if java store lock information in heap? if the answer is yes, Can we inspect thread locks by look into a heap dump file? I am using eclipse memory anlyazier but don't know how to do it.

Zabuzard
  • 25,064
  • 8
  • 58
  • 82
WestFarmer
  • 669
  • 8
  • 27

1 Answers1

1

don't know whether the lock information is available in the heap. But you can get all the thread related information in the heap using mat memory analyzer. You can use a OQL query like below to query the particular thread object and then analyze the thread object details.

SELECT s FROM java.lang.Thread s WHERE toString(s.name)="pool-thread-1"
Dil
  • 307
  • 1
  • 3
  • 15