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
2
votes
1 answer

Java 17 process running out of memory on Kubernetes when memory potentially available

The goal is to understand what should be tuned in order for the Java process to stop restarting itself. We have a Java Springboot backend application with Hazelcast running that restarts instead of garbage collecting. Environment is: Amazon…
2
votes
1 answer

When not to use G1GC garbage collector?

I looked into differences between various garbage collectors available for JVM. Here is the answer explaining the main differences between them : https://stackoverflow.com/a/54619838/5345646 Here it's said for G1GC that : It's low pause / server…
Mooncrater
  • 4,146
  • 4
  • 33
  • 62
2
votes
2 answers

G1 GC allocated memory is more than heap size

I change GC for application server. Now I use G1 GC. I have 30 GB RAM. For initial testing I set only Xms and Xmx values to be the same 23040 mb. Settings I use: -Xms23040m -Xmx23040m -XX:+UseG1GC -XX:MetaspaceSize=512M…
grep
  • 5,465
  • 12
  • 60
  • 112
2
votes
2 answers

Do all Apache Cassandra nodes need to use the same Garbage Collector?

I have recently upgraded our Cassandra cluster from 3.11 to 4.0 with the long term goal to also upgrade the Java version. I did not want to do both of these things at once for obvious reasons, however we have been upgraded on C4 for just over two…
guyver4mk
  • 609
  • 6
  • 11
2
votes
0 answers

Memory issues when using G1GC

I am a beginner Java developer. My application is using Java 8. I know that in Java 8, Parallel GC is the default. When no options are given, the memory is 500MB. However, giving the G1 GC option increases the memory to 3GB.(-XX:+UseG1GC). I know…
Hanju Kim
  • 39
  • 1
2
votes
0 answers

Why does Kafka have a lot of Sensor objects in Old gen heap?

I have a Kafka broker (2.7.1) running on Java 11. I noticed that the broker is slow because of the G1 old generation collections. Taking a heap dump reveled that about 30% of heap is used by a ConcurrentHashMap$Node which retains 1000s of…
Thomas
  • 4,119
  • 2
  • 33
  • 49
2
votes
2 answers

Garbage Collector does not release memory on his own

Why does my garbage collector(G1 GC) do not release memory altough he could? The Used Heap is going up over time, the step fall at the end is because I forced the GC to release memory through jcmd GC.run Why is that? Is that normal…
user2071938
  • 2,055
  • 6
  • 28
  • 60
2
votes
0 answers

some questions about g1 XX:MaxGCPauseMills

I have some questions about G1 GC, I know if I set -XX:MaxGCPauseMillis too small,G1 has very few regions recycled each time.GC garbage collection speed can't catch up with user thread garbage generation speed, could cause gc so frequency that…
Colin
  • 21
  • 3
2
votes
1 answer

Java 11 - G1GC - Need to understand young generation gc logs and their effect on application threads

I am running a java application with G1GC enabled and i am printing the gc logs as shown below: [4074.182s][info][gc] GC(1017) Pause Young (Normal) (G1 Evacuation Pause) 6869M->6115M(16384M) 7430.860ms [4082.328s][info][gc] GC(1018) Pause Young…
user10916892
  • 825
  • 12
  • 33
2
votes
0 answers

Detecting OutOfMemoryError - unexpected behaviour when using G1

After reading article Detecting Java OutOfMemoryError before it happens we have decided to implement such a out of memory detection in our project. Unfortunately with G1 GC it does not work as expected. The javadoc of used…
Idzik
  • 43
  • 2
2
votes
0 answers

Are AnonPages part of the heap? What are they?

AnonPages: Non-file backed pages mapped into userspace page tables Is all I find online. Does anyone know more?
Arlunn
  • 55
  • 5
2
votes
0 answers

What is AnonPages part of? Memory questions

I have an app that uses Java 8 and G1GC. I notice large spikes in AnonPages & Eden Generation from /proc/meminfo and can't seem to track it down nor find any info, all I get is "Non-file backed pages mapped into userspace page tables" which is super…
Arlunn
  • 55
  • 5
2
votes
0 answers

Java 8 G1GC Ext Root Scanning increasing with number of threads

Basics; Java 8 Oracle, 8 CPU server 4GB heap. We have a performance problem with our server and have narrowed it down to GC. Suddenly the GC performance tanks and "Ext Root Scanning" is the cause. With 1 GC thread the total time for this phase is…
Dom54
  • 21
  • 3
2
votes
1 answer

Java G1 GC | Resident memory higher than NMT reserved memory

The resident memory used by the java process, using G1GC, is much higher than the XMX and the memory reported by the NMT. java -version openjdk version "11.0.6" 2020-01-14 LTS OpenJDK Runtime Environment 18.9 (build 11.0.6+10-LTS) OpenJDK 64-Bit…
Mohit Gupta
  • 649
  • 1
  • 7
  • 15
2
votes
1 answer

WIth the G1 Collector, Can one array object be allocated to different

//VM args: -verbose:gc -Xms20M -Xmx20M -Xmn10M -XX:+PrintGCDetails -XX:SurvivorRatio=8 -XX:+UseG1GC public static void testAllocation() { byte[] allocation1, allocation2, allocation3, allocation4; allocation1 = new byte[2 * _1MB]; …
YuanXL
  • 41
  • 2