-
Notifications
You must be signed in to change notification settings - Fork 79
Description
Currently, in both Map32 and Map64, we assume MMTk is in control of the entire memory range from heap_start
to heap_end
. But if the VM uses third-party libraries, they may call mmap
and the OS will return a random memory range, which could possibly be within the heap range. This actually happened in some VMs, such as ART.
Although we currently have Mmapper::quarantine_address_range
, we only use it for side metadata, but not the memory for objects themselves. On ART, we quarantine the object spaces, too, not just metadata. (@k-sareen, correct me if I am wrong.) We have not seen problems on OpenJDK, but in theory it could happen, too. In JikesRVM, the "malloc returned something that is in RVM address space" error could possibly be caused by malloc getting mmap memory within RVM address space, although we haven't confirmed it, yet.
I suggest mmtk-core should quarantine the entire MMTk heap address range at start-up. For Map64, it is 0x200_0000_0000 to 0x2200_0000_0000, or whatever the VM binding configures at set-up time. It will help ART, and other VMs can avoid potential problems not yet observed.
Because we quarantine the entire heap, it is no longer needed to have the MapState::Quarantined
state because it is always quarantined as long as it is within the heap range.