diff --git a/region_size.py b/region_size.py index c938dfc..21b002c 100644 --- a/region_size.py +++ b/region_size.py @@ -14,25 +14,34 @@ total = 0 for line in f.read().splitlines(): - if re.search("allocation request:.*source concurrent humongous allocation", line) is not None: + if re.search("allocation request:.*source: concurrent humongous allocation", line) is not None: total += 1 req = re.search("allocation request: [0-9]+", line).group() allocations.append(int(re.search(r"[0-9]+", req).group())) print(f"found {total} humongous objects in {log}") -# humongous allocations occur when the request is >= 1/2 the region size - -mb2 = sum(map(lambda x: x < 1*ONEMB), allocations) -mb4 = sum(map(lambda x: x < 2*ONEMB), allocations) -mb8 = sum(map(lambda x: x < 4*ONEMB), allocations) -mb16 = sum(map(lambda x: x < 8*ONEMB), allocations) -mb32 = sum(map(lambda x: x < 16*ONEMB), allocations) -mbMax = sum(map(lambda x: x >= 16*ONEMB), allocations) - -print(f"{100*mb2/total}% would not be humongous with a 2mb region size (-XX:G1HeapRegionSize)") -print(f"{100*mb2/total}% would not be humongous with a 4mb region size") -print(f"{100*mb2/total}% would not be humongous with a 8mb region size") -print(f"{100*mb2/total}% would not be humongous with a 16mb region size") -print(f"{100*mb2/total}% would not be humongous with a 32mb region size") -print(f"{100*mb2/total}% would remain humongous with a 32mb region size") + +if len(allocations) > 0: + # humongous allocations occur when the request is >= 1/2 the region size + + mb2 = sum(map(lambda x: x < 1*ONEMB, allocations)) + mb4 = sum(map(lambda x: x < 2*ONEMB, allocations)) + mb8 = sum(map(lambda x: x < 4*ONEMB, allocations)) + mb16 = sum(map(lambda x: x < 8*ONEMB, allocations)) + mb32 = sum(map(lambda x: x < 16*ONEMB, allocations)) + mbMax = sum(map(lambda x: x >= 16*ONEMB, allocations)) + + print(f"{mb2/total:.2%} would not be humongous with a 2mb region size (-XX:G1HeapRegionSize)") + print(f"{mb4/total:.2%} would not be humongous with a 4mb region size") + print(f"{mb8/total:.2%} would not be humongous with a 8mb region size") + print(f"{mb16/total:.2%} would not be humongous with a 16mb region size") + print(f"{mb32/total:.2%} would not be humongous with a 32mb region size") + print(f"{mb32/total:.2%} would remain humongous with a 32mb region size") + + +#Total created bytes 1.88 gb +#Total promoted bytes n/a +#Avg creation rate 4.33 mb/sec +#Avg promotion rate n/a +