I was reading the official JDK 12 specs and had to verify something, which led me to an article that said:
"G1 collects regions with the least amount of live data (Garbage First!) and compacts/evacuates live data into new regions. Secondly, it uses a series of incremental, parallel and multi-phased cycles to achieve its soft pause time target. This allows G1 to do what’s necessary, in the time defined, irrespective of the overall heap size."
Does this imply that a variable in a low-active-data-density region could be moved to another location, in which case a variable's address will change?
Although one can dig for the exact piece of code that implements this feature of G1, I'd like to understand its consequences for memory management without going through an entire JVM implementation.