blob: 22f55199f6b5803345b3843af846d6c09c15ffde [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]
interface Monitor {
1: 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
interface Watcher {
1: OnChange(Stats stats);
};