Runtime Debugging
NOTE All other debug namespace APIs EXCEPT FOR the following APIs are restricted with rpc.unsafe-debug.disable flag:
VM Tracing APIs, however with limited functionality (only pre-defined tracers are allowed)
debug_dumpBlock, debug_dumpStateTrie, debug_getBlockRlp, debug_getModifiedAccountsByHash, debug_getModifiedAccountsByNumber, debug_getBadBlocks, debug_getModifiedStorageNodesByNumber
debug_metrics
debug_freeOSMemory
Returns unused memory to the OS.
Console
debug.freeOSMemory()
RPC
{"method": "debug_freeOSMemory"}
Parameters
None
Return Value
None
Example
Console
> debug.freeOSMemory()
nullHTTP RPC
debug_gcStats
Returns GC statistics.
Console
debug.gcStats()
RPC
{"method": "debug_gcStats", "params": []}
Parameters
None
Return Value
See https://golang.org/pkg/runtime/debug/#GCStats for information about the fields of the returned object.
Example
Console
HTTP RPC
debug_memStats
Returns detailed runtime memory statistics.
Console
debug.memStats()
RPC
{"method": "debug_memStats", "params": []}
Parameters
None
Return Value
See https://golang.org/pkg/runtime/#MemStats for information about the fields of the returned object.
Example
Console
HTTP RPC
debug_metrics
Retrieves all the known system metrics collected by the node.
Console
debug.metrics(raw)
RPC
{"method": "debug_metrics", "params": [raw]}
Parameters
raw
bool
true If raw data is output as it is, false If not
Return Value
JSON string
The structured metrics collected by the node.
Example
Console
HTTP RPC
debug_setGCPercent
Sets the garbage collection target percentage. It returns the previous setting. A negative value disables GC.
Parameters
Percent
integer
Garbage collection target percentage.
Return Value
integer
Previous garbage collection target percentage.
Example Console
HTTP RPC
debug_stacks
Returns a printed representation of the stacks of all goroutines.
Console
debug.stacks()
RPC
{"method": "debug_stacks", "params": []}
Parameters
None
Return Value
string
The stack information of all goroutines.
Example
Console
HTTP RPC
Last updated