question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ZGC memory size without unit check

See original GitHub issue

I find gctoolkit get the raw memory size in ZGCParser.java without the unit check. I think the line liked markStart[index] = trace.getLongGroup(2); should change to markStart[index] = trace.getMemoryInKBytes(2); . However, the lowest heap size of ZGC is 2MB,is the Mb will more suitable than the Kb?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ZhangShushu123commented, Jan 7, 2022

Sure. The log fragment is shown as below @kirk-microsoft .


[2021-12-28T11:32:31.233+0800][7.846s][info][gc,start    ] GC(5) Garbage Collection (Proactive)
[2021-12-28T11:32:31.234+0800][7.846s][info][gc,phases   ] GC(5) Pause Mark Start 0.082ms
[2021-12-28T11:32:31.239+0800][7.852s][info][gc,phases   ] GC(5) Concurrent Mark 5.045ms
[2021-12-28T11:32:31.239+0800][7.852s][info][gc,phases   ] GC(5) Pause Mark End 0.456ms
[2021-12-28T11:32:31.240+0800][7.852s][info][gc,phases   ] GC(5) Concurrent Process Non-Strong References 0.234ms
[2021-12-28T11:32:31.240+0800][7.852s][info][gc,phases   ] GC(5) Concurrent Reset Relocation Set 0.006ms
[2021-12-28T11:32:31.243+0800][7.856s][info][gc,phases   ] GC(5) Concurrent Select Relocation Set 3.428ms
[2021-12-28T11:32:31.243+0800][7.856s][info][gc,phases   ] GC(5) Pause Relocate Start 0.087ms
[2021-12-28T11:32:31.245+0800][7.858s][info][gc,phases   ] GC(5) Concurrent Relocate 1.660ms
[2021-12-28T11:32:31.245+0800][7.858s][info][gc,load     ] GC(5) Load: 0.46/0.96/1.09
[2021-12-28T11:32:31.245+0800][7.858s][info][gc,mmu      ] GC(5) MMU: 2ms/65.3%, 5ms/86.1%, 10ms/91.9%, 20ms/94.3%, 50ms/97.7%, 100ms/98.9%
[2021-12-28T11:32:31.245+0800][7.858s][info][gc,marking  ] GC(5) Mark: 4 stripe(s), 3 proactive flush(es), 1 terminate flush(es), 1 completion(s), 0 continuation(s) 
[2021-12-28T11:32:31.245+0800][7.858s][info][gc,reloc    ] GC(5) Relocation: Successful, 0M relocated
[2021-12-28T11:32:31.245+0800][7.858s][info][gc,nmethod  ] GC(5) NMethods: 10 registered, 0 unregistered
[2021-12-28T11:32:31.245+0800][7.858s][info][gc,metaspace] GC(5) Metaspace: 4M used, 4M capacity, 4M committed, 8M reserved
[2021-12-28T11:32:31.245+0800][7.858s][info][gc,ref      ] GC(5) Soft: 3 encountered, 0 discovered, 0 enqueued
[2021-12-28T11:32:31.245+0800][7.858s][info][gc,ref      ] GC(5) Weak: 10 encountered, 5 discovered, 0 enqueued
[2021-12-28T11:32:31.245+0800][7.858s][info][gc,ref      ] GC(5) Final: 2780 encountered, 1780 discovered, 1780 enqueued
[2021-12-28T11:32:31.245+0800][7.858s][info][gc,ref      ] GC(5) Phantom: 6 encountered, 4 discovered, 0 enqueued
[2021-12-28T11:32:31.245+0800][7.858s][info][gc,heap     ] GC(5) Min Capacity: 8M(0%)
[2021-12-28T11:32:31.245+0800][7.858s][info][gc,heap     ] GC(5) Max Capacity: 2048M(100%)
[2021-12-28T11:32:31.245+0800][7.858s][info][gc,heap     ] GC(5) Soft Max Capacity: 2048M(100%)
[2021-12-28T11:32:31.245+0800][7.858s][info][gc,heap     ] GC(5)                Mark Start          Mark End        Relocate Start      Relocate End           High               Low         
[2021-12-28T11:32:31.245+0800][7.858s][info][gc,heap     ] GC(5)  Capacity:      772M (38%)         772M (38%)         772M (38%)         772M (38%)         772M (38%)         772M (38%)    
[2021-12-28T11:32:31.245+0800][7.858s][info][gc,heap     ] GC(5)   Reserve:       62M (3%)           62M (3%)           62M (3%)           62M (3%)           62M (3%)           62M (3%)     
[2021-12-28T11:32:31.245+0800][7.858s][info][gc,heap     ] GC(5)      Free:     1334M (65%)        1332M (65%)        1586M (77%)        1592M (78%)        1592M (78%)        1332M (65%)    
[2021-12-28T11:32:31.245+0800][7.858s][info][gc,heap     ] GC(5)      Used:      652M (32%)         654M (32%)         400M (20%)         394M (19%)         654M (32%)         394M (19%)    
[2021-12-28T11:32:31.245+0800][7.858s][info][gc,heap     ] GC(5)      Live:         -               348M (17%)         348M (17%)         348M (17%)            -                  -          
[2021-12-28T11:32:31.245+0800][7.858s][info][gc,heap     ] GC(5) Allocated:         -                 2M (0%)            4M (0%)           22M (1%)             -                  -          
[2021-12-28T11:32:31.245+0800][7.858s][info][gc,heap     ] GC(5)   Garbage:         -               303M (15%)          47M (2%)           41M (2%)             -                  -          
[2021-12-28T11:32:31.245+0800][7.858s][info][gc,heap     ] GC(5) Reclaimed:         -                  -               256M (12%)         262M (13%)            -                  -          
[2021-12-28T11:32:31.245+0800][7.858s][info][gc          ] GC(5) Garbage Collection (Proactive) 652M(32%)->394M(19%)

Fragment 772M (38%) is the reason that I suggest the line liked markStart[index] = trace.getLongGroup(2); should change to markStart[index] = trace.getMemoryInKBytes(2); .

1reaction
kariannacommented, Jan 6, 2022

@kirk-microsoft So it sounds like if KBytes are assumed everywhere that the code doesn’t need to change?

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Z Garbage Collector - Oracle Help Center
The Z Garbage Collector (ZGC) is a scalable low latency garbage collector. ZGC performs all expensive work concurrently, without stopping the execution of ......
Read more >
ZGC used memory spikes upto to max - java - Stack Overflow
I tried to check if my service caught OOM but looks like nope. Here is the JVM arguments I use to run application:...
Read more >
Performance evaluation of Java garbage collectors for large ...
The Z Garbage Collector (ZGC) is a low latency GC designed to achieve pause times independent of the heap or live-set size, that...
Read more >
Memory Management at Image Run Time - GraalVM
If the same image is executed on a machine that has 32GB of RAM, the maximum Java heap size will be set to...
Read more >
Java's new Z Garbage Collector (ZGC) is very exciting - Opsian
Garbage Collection at its most basic involves identifying memory that is no longer in use and making it available for re-use.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found