| <link rel="stylesheet" href="../style.css" /> |
| |
| [TOC] |
| # fuchsia.memory.inspection |
| |
| <div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: 12</span></div> |
| |
| |
| ## **PROTOCOLS** |
| |
| ## Collector {#Collector} |
| *Defined in [fuchsia.memory.inspection/inspection.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.memory.inspection/inspection.fidl;l=11)* |
| <p>Obtains the memory usage of a fuchsia device.</p> |
| |
| |
| ### CollectJsonStats {#Collector.CollectJsonStats} |
| |
| <p>Writes to <code>socket</code> a JSON capture of the memory usage and the memory |
| bucket definition, as a well-formed UTF-8 string. |
| The socket is closed by the server after all the data is written into |
| it.</p> |
| <p>TODO(fxbug.dev/122104): Document the schema of the JSON.</p> |
| <p>Sample output: |
| {"Capture": |
| { |
| "Time":28477260758625, |
| "Kernel":{ |
| "total":1610612736, |
| "free":170565632, |
| "wired":67395584, |
| "total_heap":30904320, |
| "free_heap":1873728, |
| "vmo":1276194816, |
| "mmu":65294336, |
| "ipc":196608, |
| "other":61440 |
| }, |
| "Processes":[ |
| ["koid","name","vmos"], |
| [47325,"fonts.cm",[47353, ...]], |
| ... |
| ], |
| "VmoNames":["scudo:primary", ...], |
| "Vmos":[ |
| ["koid","name","parent_koid","committed_bytes","allocated_bytes"], |
| [47440,38,47437,4096,4096], |
| ... |
| ] |
| } |
| "Buckets": |
| [ |
| { |
| "event_code": 29, |
| "name": "BlobfsInactive", |
| "process": "blobfs\.cm", |
| "vmo": "inactive-blob-.*" |
| }, |
| ... |
| ] |
| }</p> |
| <p>For size reasons: |
| - Processes and Vmos have an initial entry that contains the names of the the fields in |
| the rest of the entries. |
| - The names of the VMOs are an index into the VMONames array.</p> |
| |
| |
| |
| #### Request {#Collector.CollectJsonStats_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>socket</code></td> |
| <td> |
| <code>handle<socket></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| |
| |
| |
| |
| |
| |