mmtk-core
mmtk-core copied to clipboard
Accounting for metadata allocated in Rust
Some GC metadata (such as work packets, remember set) are allocated in Rust, and those are not counted in the heap size. This is incorrect. We need to know how much we allocate in Rust, and count it in our heap size. We could try use our global allocator, or use a special alloc function for those Rust data structures so we can know their size.
We should look at how servo reports heap usage: https://github.com/servo/servo/blob/master/components/malloc_size_of/lib.rs and this project: https://github.com/paritytech/parity-common/blob/master/parity-util-mem/src/malloc_size.rs
@steveblackburn suggested we should escalate this. All storage other than the Java heap should be involved when accounting heap size, including rust/malloc objects, side-metadata and OpenJDK's MetaSpace.