Skip to main content

Get Stack Traces

Returns the current stack trace for each thread in the JVM. Includes lock information for blocked threads. Requires admin password.

Request

GET /nxt?requestType=getStackTraces&adminPassword=<adminPassword>&depth=<number>

Parameters

NameTypeRequiredDescription
depthintegerNoMaximum stack trace depth. Defaults to full trace. Must be >= 1.
adminPasswordstringConditionalAdmin password required if nxt.adminPassword is set.

Response

{
"threads": [
{
"id": 1,
"name": "main",
"state": "RUNNABLE",
"locks": [],
"trace": [
"java.lang.Thread.run(Thread.java:833)",
"nxt.Nxt.main(Nxt.java:123)"
]
}
],
"locks": [
{
"name": "java.util.concurrent.locks.ReentrantLock",
"hash": 123456789,
"thread": 2
}
]
}

Response Fields

FieldTypeDescription
threadsarrayArray of thread objects.
threads[].idlongThread ID.
threads[].namestringThread name.
threads[].statestringThread state (RUNNABLE, BLOCKED, WAITING, etc.).
threads[].locksarrayMonitors held by this thread.
threads[].blockedobjectLock info if thread is blocked (only present for blocked threads).
threads[].tracearrayStack trace elements.
locksarrayArray of locks with waiters.
locks[].namestringLock class name.
locks[].hashintegerLock identity hash code.
locks[].threadlongThread ID holding the lock.

Notes

  • This endpoint does not require the blockchain to be running (requireBlockchain = false).
  • Not chain-specific.
  • Requires admin password authentication (requirePassword = true).
  • Uses ManagementFactory.getThreadMXBean().dumpAllThreads() for thread information.

Source: GetStackTraces.java.

Example

curl "http://localhost:22024/nxt?requestType=getStackTraces&depth=10"