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
3
votes
2 answers

Java G1GC - Card Table (CT) vs Remembered Set (RS)

Why g1 needs both of these data structures ? My understanding is: CT holds the information about references' actual location in old generation. RS is specific to each region, each region has one RS associated with it, it stores info about outside…
user10916892
  • 825
  • 12
  • 33
3
votes
1 answer

Optimal number of GC threads for a single CPU machine

I'm using G1 garbage collector for an application that should use a single CPU core (it's a Spark job running on Yarn), but probably because JVM sees all the available cores, it uses quite large number of parallel threads, from 18 to 23. Does it…
synapse
  • 5,588
  • 6
  • 35
  • 65
3
votes
1 answer

Why doesn't the Java CMS Garbage Collector allow the used heap size to grow to the available heap size?

I am testing the differences between G1GC and the CMS Garbage collectors. Running the same program yields different heap size usages (maybe as expected). The below image shows the G1GC (left) compared to the CMS GC (right). G1GC manages to run the…
rrz0
  • 2,182
  • 5
  • 30
  • 65
3
votes
1 answer

How to properly read some parts of the logging from GC with "-Xlog:heap*=debug" "-Xlog:gc*=debug"

Suppose I have very simple code: public class Sandbox { public static void main(String[] args) { Map map = new HashMap<>(); while (true) { map.put(new Random().toString(), new…
Eugene
  • 117,005
  • 15
  • 201
  • 306
3
votes
0 answers

How Do I Identify The Humongous Objects?

I am getting a lot of Humongous Allocations when using G1GC. The server is receiving requests from about 300 clients at a time, often for large datasets of different types from the database. This is likely what is causing the Humongous Allocations,…
opticyclic
  • 7,412
  • 12
  • 81
  • 155
3
votes
0 answers

VM running out of memory despite java has a ton for free heap

My tomcat Java 8 application is running with 24GB XMX on 32GB Virtual machine with G1 GC. It processes large files. Files have size of 5-7 GBs. After deployment during the processing of one of such files VM is starting to use > 90% of allocated…
Alex Kamornikov
  • 278
  • 2
  • 10
3
votes
1 answer

A list of Hotspot VM Operations with descriptions

Java Hotspot VM can do a number of different VM operations. When debugging safepoint times it's useful to know what was the purpose of the safepoint. Some of them are obvious: G1IncCollectionPause or FindDeadlocks, but some are not: CGC_Operation,…
Imaskar
  • 2,773
  • 24
  • 35
3
votes
0 answers

G1GC long pause creating high latency

I went through all G1GC related questions over here which have been very helpful. However, I am seeing a strange behavior with G1GC. Seeing eden space getting cleared quickly with big size but taking a long time with small size. Expected GC pause…
cdatta
  • 279
  • 1
  • 9
3
votes
0 answers

Scan RS cost long time occasionally using G1

jvm using G1 works fine most of the time, but Scan RS cost long time occasionally([Scan RS (ms): Min: 4989.9, Avg: 4994.8, Max: 5006.3, Diff: 16.3, Sum: 39958.7]) Any options can be changed to optimize the Scan RS time? jvm command line -Xss1m…
hsuehfeng
  • 31
  • 2
3
votes
2 answers

Java G1 Garbage collector takes a lot of memory

I have project with large database. To parse it I use java with G1 garbage collector. When program runs for a long period of time java begins to consume a lot of memory. But when I check java heap the size is much smaller. For example: Java take…
Igor Kiulian
  • 164
  • 8
3
votes
2 answers

Java hangs for several seconds, but no gc pause found in gc log

I have a java application running on Linux (CentOS 7) using g1 gc, and it regularly hangs for several seconds, it looks just like gc pauses, but I can't find such long pauses in gc log. To make sure that the java application hangs, I started a…
T.Tony
  • 495
  • 3
  • 15
3
votes
0 answers

Young Generation GC spending too much time on EXT Root Scanning

I have an Java Application spending significant time on G1 Gc particularly on young gen. [Ext Root Scanning (ms): Min: 10.4, Avg: 21.4, Max: 137.2, Diff: 126.8, Sum: 385.2] It is spending a significant time doing Ext Root Scanning. I cannot figure…
3
votes
2 answers

Adaptive Sizing in JVM garbage collectors

For Oracle JVM 1.8 Server mode, can Parallel, CMS, and G1 collectors dynamically change the ratio of the young generation to old generation? What is the default ratio of the young generation to old generation in these three collectors? Parallel =…
Lijie Xu
  • 250
  • 2
  • 9
3
votes
2 answers

High memory usage issues with G1 Garbage collector

We have been testing out G1 garbage collector recently with the following configuration: -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseG1GC -XX:MaxGCPauseMillis=1250 -XX:+PrintTenuringDistribution -Xloggc:${logdir}/gc-$(date…
Anish Gupta
  • 293
  • 1
  • 5
  • 18
3
votes
2 answers

G1 garbage collection causing variable value to be reset?

If I run the following code with the -XX:+UseG1GC flag, every couple of runs the cellSize_m variable will get set to 0 inside the loop and I'll get the "Now it's broken" printouts. What am I missing here? public class BugTest { public static void…
brainchrist
  • 184
  • 2
  • 8