On Thu, 31 Oct 2024 03:52:16 GMT, Ioi Lam <ik...@openjdk.org> wrote: > When lots of classes are loaded during `java -Xshare:dump`, the internal > arrays used by some of the HashMaps and ArrayLists become too large to be > archived by CDS (> 256KB). > > At the very end of Java bytecode execution during `java -Xshare:dump`, we > used to call `clear()` on these tables to free their elements (*) -- these > tables are repopulated at run time when classes are loaded incrementally. > However, the `clear()` call doesn't resize the internal arrays. > > The fix is to re-ininitialize these tables to new, empty tables that have > small internal arrays. > > === > (*) the call to `resetArchivedStates()` is made from > [HeapShared::reset_archived_object_states()](https://github.com/openjdk/jdk/blob/688e92e7f5febddd2935cb7f500dd3f10fbd9401/src/hotspot/share/cds/metaspaceShared.cpp#L799)
This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/21797