blob: ef6efdc27442c6d19e680551cd35764eb4b7e260 [file] [log] [blame]
// Copyright 2017 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.memory;
/// Interface used to register for memory notifications.
[Discoverable]
protocol Monitor {
Watch(Watcher watcher);
};
struct Stats {
/// The total amount of physical memory available to the system.
uint64 total_bytes;
/// The amount of unallocated memory.
uint64 free_bytes;
/// The amount of memory reserved by and mapped into the kernel for reasons
/// not covered by other fields in this struct. Typically for readonly data
/// like the ram disk and kernel image, and for early-boot dynamic memory.
uint64 wired_bytes;
/// The amount of memory allocated to the kernel heap.
uint64 total_heap_bytes;
/// The portion of `total_heap_bytes` that is not in use.
uint64 free_heap_bytes;
/// The amount of memory committed to VMOs, both kernel and user.
/// A superset of all userspace memory.
/// Does not include certain VMOs that fall under `wired_bytes`.
uint64 vmo_bytes;
/// The amount of memory used for architecture-specific MMU metadata
/// like page tables.
uint64 mmu_overhead_bytes;
/// The amount of memory in use by IPC.
uint64 ipc_bytes;
/// Non-free memory that isn't accounted for in any other field.
uint64 other_bytes;
};
/// A watcher for memory changes
protocol Watcher {
OnChange(Stats stats);
};