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

Remove redundant zeroing for OpenJDK and V8

Open wenyuzhao opened this issue 3 years ago • 2 comments

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.

wenyuzhao avatar Jul 22 '21 05:07 wenyuzhao

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.

qinsoon avatar Jul 23 '21 03:07 qinsoon

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.

qinsoon avatar Aug 30 '21 03:08 qinsoon