Skip to content

Commit c5d65e5

Browse files
committed
Add memory_metrics to canister_status.
1 parent 888e596 commit c5d65e5

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

docs/references/_attachments/ic.did

+12
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,18 @@ type canister_status_result = record {
248248
settings : definite_canister_settings;
249249
module_hash : opt blob;
250250
memory_size : nat;
251+
memory_metrics : record {
252+
// execution memory
253+
heap_size : nat;
254+
stable_size : nat;
255+
global_size : nat;
256+
wasm_binary_size : nat;
257+
custom_sections_size : nat;
258+
// system memory
259+
canister_history_size : nat;
260+
wasm_chunk_store_size : nat;
261+
snapshot_size : nat;
262+
};
251263
cycles : nat;
252264
reserved_cycles : nat;
253265
idle_cycles_burned_per_day : nat;

docs/references/ic-interface-spec.md

+19-1
Original file line numberDiff line numberDiff line change
@@ -2273,7 +2273,25 @@ Indicates various information about the canister. It contains:
22732273

22742274
- A SHA256 hash of the module installed on the canister. This is `null` if the canister is empty.
22752275

2276-
- The actual memory usage of the canister.
2276+
- The total memory usage of the canister, which includes all types of memory consumed by the canister.
2277+
2278+
- Detailed breakdown of memory usage into individual components (in bytes):
2279+
2280+
* `heap_size`: Represents the total Wasm memory usage of the execution state, which includes the heap memory used by the canister's WebAssembly code.
2281+
2282+
* `stable_size`: Indicates the total stable memory usage of the execution state, which is the memory that persists across canister upgrades.
2283+
2284+
* `global_size`: The total global memory usage of the execution state, encompassing all global variables used by the canister.
2285+
2286+
* `wasm_binary_size`: The total memory occupied by the Wasm binary itself within the execution state.
2287+
2288+
* `custom_sections_size`: The memory used by custom sections within the execution state, which may include additional metadata or configuration data.
2289+
2290+
* `canister_history_size`: The total memory allocated for storing the canister's history within the system state, which includes records of past actions and changes.
2291+
2292+
* `wasm_chunk_store_size`: The memory used by the Wasm chunk store within the system state, which is used to store large Wasm modules in chunks.
2293+
2294+
* `snapshot_size`: The total memory consumed by snapshots within the system state, which are used to capture the state of the canister at specific points in time.
22772295

22782296
- The cycle balance of the canister.
22792297

0 commit comments

Comments
 (0)