Skip to content

Commit

Permalink
fixed errors
Browse files Browse the repository at this point in the history
  • Loading branch information
bschoening committed Nov 16, 2021
1 parent 2f1f2e3 commit d28ae18
Showing 1 changed file with 25 additions and 16 deletions.
41 changes: 25 additions & 16 deletions region_size.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d28ae18

Please sign in to comment.