Re: [rvm-research] turning off zeroing

Eliot Moss <[email protected]> Wed, 19 Sep 2018 11:10:47 -0400
Newsgroups gmane.comp.java.jikes.rvm.devel
Message-ID <[email protected]>
On 9/19/2018 11:06 AM, Shoaib Akram wrote:
> Thank you all for your input. It helps! I have two questions:
> 
> (1) The OS can also zero pages before handing them out to user level libraries. Since Jikes RVM uses mmap to reserve memory for program heap, is it possible there is duplication of effort. Specifically, there is get_zeroed_page() in the kernel. Why is that not enough to provide memory safety?

After a GC, the pages get reused, so need to be zeroed again.  It is possible (might even be done)
to avoid the first zeroing.

> (2) Do Jikes RVM (and JVMs in general) zero mature spaces? Copying is implicit initialization. Are there optimizations in place to elide zeroing of mature space? I guess the JVM can not entirely elide zeroing of mature spaces. Because the mutator may decide to pre-tenure objects in which case, the memory returned should be zeroed.

By the above argument, they would tend to be zeroed by the mmap.  But perhaps there are
obscure cases that would require it.

Eliot Moss