metaspace.hpp is included by about 770 out of 1000 HotSpot .o files. Most of these are transitively included via array.hpp and classLoaderData.hpp.
classLoaderData.hpp doesn't actually need metaspace.hpp. array.hpp can be refactored to put functions that depend on metaspace.hpp into array.inline.hpp
Doing the above reduces the number of .o files that include metaspace.hpp to 343. Since this is still a significant number, we should split out the rarely used parts (such as MetaspaceGC, MetaspaceUtils) into a new header file (metaspaceUtils.hpp, which is included only 30 times).
Also, these 3 includes can now be removed from metaspace.hpp.
#include "memory/memRegion.hpp"
#include "memory/metaspaceChunkFreeListSummary.hpp"
#include "memory/virtualspace.hpp"
classLoaderData.hpp doesn't actually need metaspace.hpp. array.hpp can be refactored to put functions that depend on metaspace.hpp into array.inline.hpp
Doing the above reduces the number of .o files that include metaspace.hpp to 343. Since this is still a significant number, we should split out the rarely used parts (such as MetaspaceGC, MetaspaceUtils) into a new header file (metaspaceUtils.hpp, which is included only 30 times).
Also, these 3 includes can now be removed from metaspace.hpp.
#include "memory/memRegion.hpp"
#include "memory/metaspaceChunkFreeListSummary.hpp"
#include "memory/virtualspace.hpp"
- links to
-
Review openjdk/jdk/2599