當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Bitcoin getmemoryinfo用法及代碼示例

比特幣(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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。