比特币(Bitcoin) RPC Control API中getmemoryinfo的用法及代码示例。
用法:
getmemoryinfo ( "mode" )
返回一个包含有关内存使用情况信息的对象。
参数1 - mode
类型:字符串,可选,默认=“ stats”
- 确定返回哪种信息。
“stats”返回有关守护程序中内存使用情况的常规统计信息。
“mallocinfo”返回描述低级堆状态的XML字符串(仅在使用glibc 2.10+编译时可用)。
结果(模式“stats”)
{
"locked": { (json object) Information about locked memory manager
"used": xxxxx, (numeric) Number of bytes used
"free": xxxxx, (numeric) Number of bytes available in current arenas
"total": xxxxxxx, (numeric) Total number of bytes managed
"locked": xxxxxx, (numeric) Amount of bytes that succeeded locking. If this number is smaller than total, locking pages failed at some point and key data could be swapped to disk.
"chunks_used": xxxxx, (numeric) Number allocated chunks
"chunks_free": xxxxx, (numeric) Number unused chunks
}
}
结果(模式“mallocinfo”)
"<malloc version="1">..."
示例
bitcoin-cli getmemoryinfo
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getmemoryinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
相关用法
注:本文由纯净天空筛选整理自bitcoin.org大神的英文原创作品 Bitcoin getmemoryinfo。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。