mmtk-core icon indicating copy to clipboard operation
mmtk-core copied to clipboard

Accounting for metadata allocated in Rust

Open qinsoon opened this issue 4 years ago • 2 comments

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.

qinsoon avatar Feb 17 '21 02:02 qinsoon

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

qinsoon avatar Apr 08 '21 05:04 qinsoon

@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.

wenyuzhao avatar Feb 02 '22 03:02 wenyuzhao