[crac] RFR: 8321660: [CRaC] Trim native heap before checkpoint to decrease image size [v3]

Radim Vansa rvansa at openjdk.org
Tue Dec 12 07:58:46 UTC 2023


On Mon, 11 Dec 2023 16:27:58 GMT, Volker Simonis <simonis at openjdk.org> wrote:

>> Before checkpointing, we should trim the native C-heap in order to decrease the size of the generated CRaC image.
>> 
>> Without C-heap trimming, the size of a HelloWorld image is ~32m and the one for SpringPetclinic ~209m. If we trim the C-heap before checkpointin, the image size decreses to ~30m for HelloWorld and 170m for SpringPetclinic.
>> 
>> I've also added a new logging tag `crac` because I think it would be nice to log more CRaC details/internals in universal logging.  
>> 
>> Please let me know what you think?
>
> Volker Simonis has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Need to unconditionally include os.inline.hpp. This will automatically include the right platform-specific .inline.hpp files

Marked as reviewed by rvansa (Committer).

The point is that if you want to squeeze the most of trimming heap, you don't want either the VM operation itself or any racing threads to inflate the memory again before the checkpoint happens.
On the other hand, if the trimming is ignored at safepoint (I haven't studied the PR in detail, but some of the comments suggest that), it's a valid choice to do it before.

The test failures look OK, the tier1 failures should be hopefully fixed after merging more recent mainline.

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

PR Review: https://git.openjdk.org/crac/pull/148#pullrequestreview-1776849350
PR Comment: https://git.openjdk.org/crac/pull/148#issuecomment-1851470752


More information about the crac-dev mailing list