RFR(S) 8252481 Remove excessive include of memTracker.hpp

Ioi Lam ioi.lam at oracle.com
Mon Aug 31 20:21:03 UTC 2020


Hi Calvin,

Thanks for the review.

On 8/31/20 11:35 AM, calvin.cheung at oracle.com wrote:
> Hi Ioi,
>
> Looks good. Just one nit in jfrAllocation.cpp:
>
>   26 #include "jfr/utilities/jfrAllocation.hpp"
>   27 #include "jfr/recorder/jfrRecorder.hpp"
>   28 #include "jfr/utilities/jfrAllocation.hpp"
>

Good catch. I added line 26 for debugging purpose. I'll remove it.

Thanks
- Ioi

> Line 28 is extra?
>
> thanks,
> Calvin
> On 8/27/20 10:21 PM, Ioi Lam wrote:
>> 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