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
1
vote
1 answer

G1 does not allow to allocate large object while Parallel does

openjdk 11.0.14.1 2022-02-08 Consider the following simple Java program. public static void main( String[] args ){ int i[] = new int[Integer.MAX_VALUE / 2]; } Here int is 4 byte in size so allocating int[Integer.MAX_VALUE / 2] requires 4G of…
Some Name
  • 8,555
  • 5
  • 27
  • 77
1
vote
0 answers

ZGC out of memory error when moving from G1GC

I have an application in Java 17 configured like so: -Xms4096m -Xmx4096m -XX:+UseG1GC -XX:MaxMetaspaceSize=1024m It's a rather large web service that is pretty memory intensive over the years that's grown from a baseline other services…
RMSD
  • 476
  • 5
  • 12
1
vote
0 answers

Eden space suddenly shrinks and Old Gen grow very high

I have the same issue described in Why is the JVM suddenly shrinking eden space and enlarging old space? (causing performance issues) with the Tomcat 8.5.73 image running the following openJDK version : openjdk 11.0.13 2021-10-19 OpenJDK Runtime…
guiliguili
  • 11
  • 1
1
vote
1 answer

Garbage Collection tuning in Java8 using G1GC

We are trying to improve our app performance and are doing a performance testing. We have a Linux VM with 4 cores and 16 GB memory. The application has more then 100 users and are complaining of slowness. Here are the performance tuning we have done…
Jude
  • 19
  • 1
1
vote
0 answers

CircuitBreakException Elasticsearch

My setup is 1 master node and 18 data node.My master node also data node.My tps events/sec 70-100 and my jvm options like this. Elasticsearch version 7.5.0 open-jdk 13 Active primary shards : 5404 Active shards : 10064 Machines has a 32 GB Memory.…
1
vote
0 answers

G1GC Regime Change After Enabling Profiling Feature

I was profiling an java process, and metrics did not seem out of place. I kept on eye on them for a couple of hours, and then I decided to turn on Object Allocation Count so I could see the rate at which new object are allocated. Somehow this caused…
MarkoPaulo
  • 474
  • 4
  • 19
1
vote
0 answers

G1GC long pause in Cassandra causing dropped mutation

I am running 3 DC with 10 nodes Cassandra 3.0.11 cluster. I frequently see the following messages WARN [Service Thread] 2021-02-10 14:03:10,219 GCInspector.java:282 - G1 Young Generation GC in 1317ms. G1 Eden Space: 4546625536 -> 0; G1 Old Gen:…
developthou
  • 343
  • 1
  • 10
1
vote
0 answers

g1 gc write barrier: exclusive-or and shifts

I am reading the paper Garbage-First Garbage Collection (http://cs.williams.edu/~dbarowy/cs334s18/assets/p37-detlefs.pdf), in section 2.2 it mentions the write barrier. In order to filter out the object from the same region, it has the following…
Canshi Wei
  • 55
  • 1
  • 5
1
vote
2 answers

Can static variable be initialized many times, because of class unloading?

Hello guys, when I watched presentation about G1GC, I learned, that this GC can make unload of the class, during collecting garbages. Lets imagine, that we have such a class. public class Foo { public static int a = 5; } And lets assume that we…
MyWay
  • 1,011
  • 2
  • 14
  • 35
1
vote
1 answer

What does "Other" mean in Java GC log?

I have such setup Java 11 Corretto inside Docker running on EC2 Java options: -Xms1200m -Xmx1200m -XX:+UseG1GC -Xlog:gc* In log I see that usually GC takes ~100-200ms, but for some timeslots, I see some weird behavior: [2074.114s][info][gc,phases…
Aleksandr Filichkin
  • 660
  • 2
  • 8
  • 22
1
vote
1 answer

How roots from stack are managed in G1 GC

How does Java manage Root objects from the stack in G1 garbage collector? Does it traverse the stacks of all the mutator threads while garbage collecting(young or mixed phase) or is there some other data structures similar remember sets (used to…
underhood31
  • 115
  • 7
1
vote
0 answers

G1GC - surge in number of young collection

We are using Oracle JDK 12 for our elasticsearch cluster with the following JVM…
ffff
  • 2,853
  • 1
  • 25
  • 44
1
vote
2 answers

How to reduce CPU usage for Java 11 with G1GC on GCP

I have: the application multi thread, low latency OpenJDK 64-Bit Server VM version 11.0.7+10 configuration is Xms=6g Xmx=12g machine is 12CPU started in GCP (Google Cloud Platform) in Kubernetes Problem is: when I migrate from java8 to java11 I…
THM
  • 579
  • 6
  • 25
1
vote
0 answers

Application is taking more time to process the JNI weak reference during remark phase of G1GC

The application is running to unexpected behavior due to this long GC and am trying to bring the GC time below 500ms. Snippet from GC logs: 2020-03-17T16:50:04.505+0900: 1233.742: [GC remark 2020-03-17T16:50:04.539+0900: 1233.776: [GC…
1
vote
0 answers

Tuning G1GC young collection frequency

I've an application that's using an off-heap byte array to read data from and pushes it into a primitive (key and value) heap based Hashmap. I've allocated 4G to my application, running it for 10 minutes show 14MB of max heap usage, but within that…
Abidi
  • 7,846
  • 14
  • 43
  • 65