Questions tagged [g1gc]

G1 or Garbage First is a generational partially collecting concurrent and parallel garbage collection algorithm. It is targeted for multi-processor machines with large memories and can meet soft realtime requirements with garbage collection (GC) pause time goals. An implementation of the G1 currently ships with the new Java 7 VMS - officially supported from JDK7 update 4.

G1 or "Garbage First" is a generational partially collecting concurrent and parallel garbage collection algorithm. It is targeted for multi-processor machines with large memories and can meet soft realtime requirements with garbage collection (GC) pause time goals.

An implementation of the G1 currently ships with the Java Hotspot 7 VM - officially supported from JDK7 update 4.

Resources

314 questions
7
votes
1 answer

Why is the Java G1 gc spending so much time scanning RS?

I'm currently evaluating the G1 garbage collector and how it performs for our application. Looking at the gc-log, I noticed a lot of collections have very long "Scan RS" phases: 7968.869: [GC pause (mixed), 10.27831700 secs] [Parallel Time:…
JohannesR
  • 1,646
  • 1
  • 12
  • 12
6
votes
1 answer

InitiatingHeapOccupancyPercent is set to 40 yet old gen memory going beyond 60 percent in G1GC

I am trying to solve a problem where the heap memory is going beyond 90 percent in my java service. Below is the heap configuration I am using, -Xms6144m \ -Xmx6144m \ -verbose:gc \ …
Amandeep Singh
  • 3,754
  • 8
  • 51
  • 72
6
votes
1 answer

Java G1 GC: Programmatically finding the number of humongous regions before/after GC

I would like to programmatically find the number of humongous regions before/after a GC has run, in order to report it to an external monitoring service. I'm able to find information like GC action, duration and memory usage before/after using…
haroba
  • 2,120
  • 4
  • 22
  • 37
6
votes
2 answers

Why is Java 10 recommended if you're using the G1 GC?

Java 10 reduces Full GC pause times by iteratively improving on its existing algorithm. -XX:ParallelGCThreads As I understood it G1 does not run its collection cycles concurrently with our application. It will still pause the application…
Varun
  • 196
  • 1
  • 20
6
votes
1 answer

G1 GC - Large background I/O causing JVM unresponsive - a 8sec pause

We have a java application which need almost Realtime response. But we are also seeing pauses up to 8sec. Special running condition: In some intervals the application would serialize a huge data snapshot of size up to 1.5G in to the disk (SSD).…
6
votes
1 answer

GC Logs Overwritten when JVM Crashes

I'm tuning our product for G1GC, and as part of that testing, I'm experiencing regular segfaults on my Spark Workers, which of course causes the JVM to crash. When this happens, the Spark Worker/Executor JVM automagically restarts itself, which…
liltitus27
  • 1,670
  • 5
  • 29
  • 46
6
votes
2 answers

Java G1GC sudden System usage spike 100%

We are using java 1.8.144_b_01. We have a problem where G1GC sys usage spike suddenly eg: from 1 to 113 , 140 which is very high than user space cpu usage. At that time Object Copy time becomes very high ~10 times the normal , i see the following…
techagrammer
  • 1,291
  • 8
  • 19
6
votes
2 answers

G1GC OutOfMemory too early

My test code: int SIZE = 1900; int[][] array = new int[SIZE][]; for (int i = 0; i < SIZE; i++) { array[i] = new int[1024 * 1024 / 4]; // 1MB Thread.sleep(10); if (i % 100 == 0 && i != 0) { System.out.println(i + "Mb added"); } } I…
Eugene To
  • 1,890
  • 2
  • 19
  • 30
6
votes
1 answer

Docs/code/detailed explanation for "Ext Root Scanning" on G1 gc?

1] Can anyone point to docs or explain in detail how "Ext Root Scanning" works in G1 GC, especially for JNI handles? (Specific to Java 7 if possible please) 2] Bonus: How different can we expect the openJDK code for G1 gc to be from Hotspot? If we…
carlsborg
  • 2,628
  • 19
  • 21
6
votes
1 answer

Does G1 GC have a max size of region or max amount of region?

when i studied G1 GC, I found this article: http://www.oracle.com/technetwork/articles/java/g1gc-1984535.html. In that article, there is something says as follow: The G1 GC is a regionalized and generational garbage collector, which means that the…
ho yoje
  • 355
  • 2
  • 9
6
votes
1 answer

Java VM does not recognize -XX:G1YoungGenSize?

I am using the G1 garbage collector with JDK1.7.0, but the VM does not recognize the option G1YoungGenSize. Specifically, when I run: java -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1YoungGenSize=512m ... I get the following…
6
votes
1 answer

Why max heap size is incorrect when I enable G1 garbage collector?

When I enable G1 in java application with -Xmx=1024m -XX:+UseG1GC. And using jvisualvm command to check max heap size. The max heap size is 2GB instead of 1GB. Does anybody know why ?
5
votes
1 answer

Java 8 to Java 17 migration causing significant memory increase in Docker container

Could you kindly help us with a query we have regarding a Java 8 Spring boot application running in Docker containers in ECS? After migrating to Java 17, we observed a significant 1GB increase in memory usage of the container as compared to the…
5
votes
1 answer

jdk11 g1gc spend a lot of time on prepare TLABs

gc.log shows that Prepare TLABs phase spends for about 57 second which is unaccpetable. Furthermore, this situation has only happened once in five days. I just want to figure out what happened accutally and how to…
JasonYu
  • 61
  • 3
5
votes
2 answers

G1GC Old Gen committed heap keeps growing, used is constant - leads to Eden starvation

The G1GC old generation committed heap goes up over time (about 5 to 6 days on production) but the old generation used heap does not. The Eden and survivor heap is forced to decrease to the minimum (5% of the total heap) and so garbage collection…