RFR: JDK-8274249: ZGC: Bulk free empty relocated pages [v3]

王超 github.com+25214855+casparcwang at openjdk.java.net
Mon Oct 11 13:10:10 UTC 2021


On Mon, 11 Oct 2021 08:49:57 GMT, Per Liden <pliden at openjdk.org> wrote:

> You're right that `_empty_pages` needs to be worker local (or protected by a lock). However, you can't use `ZPerWorker` like you do here, since you would be allocating a new worker local storage every time we do relocation. A `ZPerWorker` instance is semi-static, i.e. can only be initialized once and it will never deallocated its backing storage.

Thank you for your review.

Directly use `ZPerWorker` like this will lead to memory leak. So I just changed it to a static variable.

-------------

PR: https://git.openjdk.java.net/jdk/pull/5670



More information about the hotspot-gc-dev mailing list