mmtk / mmtk-core

Memory Management ToolKit
https://www.mmtk.io
Other
379 stars 69 forks source link

Expose whether _default_ space for Plan can pin objects or not #1187

Open k-sareen opened 3 months ago

k-sareen commented 3 months ago

This is useful if you want to allocate non-moving objects into the default space and pin them instead of having a separate non-moving space.

qinsoon commented 3 months ago

I plan to expose some info about spaces to bindings. But those are mostly for debugging, or for bindings to do optimizations for certain plans.

if you want to allocate non-moving objects into the default space and pin them instead of having a separate non-moving space.

Why do you want to use pin instead of non moving?

k-sareen commented 3 months ago

Pinning needs to be enabled for the ZygoteSpace since we compact into it. And if we already have the pin bit, then we can just use that instead of having a separate non-moving space if the selected plan is Immix-based.

EDIT: This is also useful for JNI critical sections as we can just pin the object instead of deferring or disabling GC