mmtk-core
mmtk-core copied to clipboard
Remove redundant zeroing for OpenJDK and V8
Currently, MMTk will always use zeroed memory for allocation. However, OpenJDK internally will do another round of zeroing, which is redundant. We need to either disable OpenJDK internal zeroing or make MMTk not doing zeroing at all.
V8 does not require zeroing. So we may want to disable zeroing for V8 as well.
Bulk zeroing can only be done in mmtk-core. However, if a binding would like to zero each object themselves, we can support this (and avoid double zeroing) by providing an option to disable zeroing in mmtk-core.
One other thing we may want to check is whether the OS gives zeroed memory with mmap. In Linux, the OS gives us zeroed memory, for which we do not need to zero it again. However, if a piece of memory is reused (not directly from mmap), we still need to zero.