RFR(S) 8252481 Remove excessive include of memTracker.hpp
Ioi Lam
ioi.lam at oracle.com
Fri Aug 28 05:21:33 UTC 2020
https://bugs.openjdk.java.net/browse/JDK-8252481
http://cr.openjdk.java.net/~iklam/jdk16/8252481-excessive-memTracker-hpp.v01/
memTracker.hpp is included by 847 out of 971 .o files in the HotSpot build.
Most of these are caused by these header files:
jfrAllocation.hpp -- completely unnecessary
allocation.hpp, allocation.inline.hpp -- the use of CURRENT_PC can be
avoid by calling this function instead:
char* AllocateHeap(size_t size,
MEMFLAGS flags,
AllocFailType alloc_failmode /* =
AllocFailStrategy::EXIT_OOM*/) {
return AllocateHeap(size, flags, CALLER_PC);
}
======================
Before:
$ cd build/linux-x64
$ find hotspot -name \*.o | wc -l
971
$ find hotspot -name \*.d | xargs grep -l memTracker.hpp | wc -l
847
$ find hotspot -name \*.d | xargs cat | wc -l
528505
After:
$ find hotspot -name \*.d | xargs grep -l memTracker.hpp | wc -l
95
$ find hotspot -name \*.d | xargs cat | wc -l
512731
The total number of included header files has reduced for about 3%
512731 / 528505 = 0.970
======================
Testing -- I am running mach5 tiers 1-4.
More information about the hotspot-runtime-dev
mailing list