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

Should we copy objects from nursery to LOS

Open qinsoon opened this issue 4 years ago • 5 comments

Currently our generational plans do not copy objects from the nursery to large object space. For large objects, we directly allocate them into LOS. This also means for objects in the nursery, they will be copied only to the mature space. If the mature space has its own object size limit (like immix space), the limit will also apply to the nursery space, which can be overly restrictive. E.g. for generational plans, we set the limit to be 16 pages, but for generational immix, it will be half a block (8 pages). I am not sure about the performance implication.

However, we need to note that this (the current implementation) is different from Java MMTk. In Java MMTk, the max non-los object size is very large (the largest object size an allocator can deal with). And during copying, the collector will check the object size during copying and may choose the LOS copying allocator for large objects.

qinsoon avatar Sep 20 '21 01:09 qinsoon

With a discussion with Steve, this does not seem to be an issue. We could just use the min of size limits of generational and immix and use it as the size limit for generational immix.

qinsoon avatar Sep 20 '21 03:09 qinsoon

I think @steveblackburn also mentioned that we might want to add an assertion to check the size the object that is to be copied from the nursery. Any such object should be smaller than the size limit of the mature space, otherwise, we would have already allocated it into LOS in the first place.

caizixian avatar Sep 20 '21 12:09 caizixian

I think I will reopen this until an assertion is added.

caizixian avatar Sep 20 '21 12:09 caizixian

Wenyu mentioned that the object size may change during copying. For example, JikesRVM may add an extra word to objects during copying. This means an object whose size is fine with the size limit may exceed the size limit during copying. In this case, we would have to check size during copying.

qinsoon avatar Sep 22 '21 03:09 qinsoon

Another overlooked point in the current implementation is the allocation semantic during copying. Basically we are ignoring that, as we only copy from nursery to mature. If we are going to copy from nursery to mature/LOS, we would need to deal with allocation semantic properly.

qinsoon avatar Sep 22 '21 03:09 qinsoon