Integrated: JDK-8276983: Small fixes to DumpAllocStat::print_stats
    Thomas Stuefe 
    stuefe at openjdk.java.net
       
    Mon Nov 15 06:50:43 UTC 2021
    
    
  
On Thu, 11 Nov 2021 06:15:32 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
> When looking at CDS code in the context of Lilliput, I had to spend some time in DumpAllocStat::print(). I noticed two small things which can be fixed independently:
> 
> - the divide-by-zero check at lines 45ff is not needed, since `percent_of` does this already. It also can cause the asserts at the end of the function to fire wrongly.
> 
> - About those asserts: it makes sense to flush the debug message before scope end, otherwise, we won't see the debug message if the asserts fire. If they fire, the debug message would be helpful.
> 
> I also improved the assert message somewhat. I noticed that all sizes in this method are `int`, but left it that way because changing it would have too many ripple effects. I guess we won't get CDS archives beyond int_max any time soon.
> 
> Thanks, Thomas
This pull request has now been integrated.
Changeset: 296780c7
Author:    Thomas Stuefe <stuefe at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/296780c7ae5c129d24997007600f428b697d3365
Stats:     13 lines in 1 file changed: 3 ins; 8 del; 2 mod
8276983: Small fixes to DumpAllocStat::print_stats
Reviewed-by: dholmes, iklam
-------------
PR: https://git.openjdk.java.net/jdk/pull/6347
    
    
More information about the serviceability-dev
mailing list