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.

Client
Method Invocation

Console

debug.freeOSMemory()

RPC

{"method": "debug_freeOSMemory"}

Parameters

None

Return Value

None

Example

Console

> debug.freeOSMemory()
null

HTTP RPC

debug_gcStats

Returns GC statistics.

Client
Method Invocation

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.

Client
Method Invocation

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.

Client
Method Invocation

Console

debug.metrics(raw)

RPC

{"method": "debug_metrics", "params": [raw]}

Parameters

Name
Type
Description

raw

bool

raw 데이터 자체로 출력하면 true를 반환하고, 그렇지 않으면 false를 반환합니다.

Return Value

Type
Description

JSON string

노드가 수집한, 구조화된 측정 수치입니다.

Example

Console

HTTP RPC

debug_setGCPercent

Sets the garbage collection target percentage. It returns the previous setting. A negative value disables GC.

Parameters

Name
Type
Description

Percent

integer

설정할 GC 비율입니다.

Return Value

Type
Description

integer

이전에 설정된 GC 비율입니다.

Example Console

HTTP RPC

debug_stacks

Returns a printed representation of the stacks of all goroutines.

Client
Method Invocation

Console

debug.stacks()

RPC

{"method": "debug_stacks", "params": []}

Parameters

None

Return Value

Type
Description

string

모든 go루틴의 스택 정보입니다.

Example

Console

HTTP RPC

Last updated

Was this helpful?