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

Short-lived java applications: How to tune G1 to kick in later?

I've got short-living applications which usually (but not always) do not need any GC (fits in heap, epsilon GC proves this by not causing an OOM). Interestingly, G1 still kicks in very early even though there's still plenty of heap…
MRalwasser
  • 15,605
  • 15
  • 101
  • 147
8
votes
1 answer

Java G1GC is never collecting Old Gen

I was running my surefire tests and it got me into GC Overhead limit. However, after analyzing memory statistics and snapshots I realized that almost 800 MB was wasted in String Duplication. Looking more into VM arguments and other runtime…
dharam
  • 7,882
  • 15
  • 65
  • 93
8
votes
3 answers

Using G1GC garbage collector with spark 2.3

I am trying to use the G1GC garbage collector for spark job but I get a Error: Invalid argument to --conf: -XX:+UseG1GC I tried using these options but haven't been able to get it working spark-submit --master spark://192.168.60.20:7077 --conf…
Clock Slave
  • 7,627
  • 15
  • 68
  • 109
7
votes
4 answers

Is there a GC in Java that does not introduce latency (stop-the-world) by perhaps running 100% concurrently?

Just curious. I heard something about the new G1GC addressing that latency problem. I can't / don't want to use RTSJ. Thanks in advance
JohnPristine
  • 3,485
  • 5
  • 30
  • 49
7
votes
3 answers

Why do I get GC more often when I raise memory?

I have a question about g1gc. These are the heap usage graph. The above is -Xms4g -Xmx4g. The bottom is -Xms8g -Xmx8g. I don't know why the 8g option causes g1gc to happen more often. Other options are all default. And server spec is 40 logical…
Songkey
  • 101
  • 2
  • 9
7
votes
2 answers

G1GC very high GC count and CPU, very frequency GCs that kill performance

I've recently switched my Java application from CMS + ParNew to G1GC. What I observed when I did the switch is the CPU usage went higher and the GC count + pause time went up as well. My JVM flags before the switched were java -Xmx22467m -Xms22467m…
Michael P
  • 2,017
  • 3
  • 25
  • 33
7
votes
2 answers

Why is heap divided into Eden, Survivor spaces and Old Generation?

Could you please answer me a question about JVM Garbage Collection process? Why is heap divided into Eden, Survivor spaces and Old Generation? When a young evacuation is processed objects are visited through references starting from the roots to…
user5536368
7
votes
1 answer

Is UseGCOverheadLimit supported with G1 GC?

In HotSpot JVM GC Tuning Guide the UseGCOverheadLimit option is mentioned only on the pages about CMS and Parallel GCs. Additionally, on GC Ergonomics doc page the related options GCTimeLimit and GCHeapFreeLimit are mentioned like if they work only…
leventov
  • 14,760
  • 11
  • 69
  • 98
7
votes
1 answer

Unnecessary Full GC with the G1 garbage collector in Java 8?

We noticed occasional full GC’s with G1 garbage collector with concurrent-mark overflow. Once, there is a concurrent-mark-reset-for-overflow, this overflow will continue in the next concurrent mark phases. Eventually, it leads to the full GC since…
Jeff
  • 71
  • 1
  • 4
7
votes
2 answers

How can I tune G1GC for smaller memory footprint?

I have been experimenting with G1GC with Java 8 (Oracle JVM) on one of my projects. My GC flags are effectively: -Xms64m -Xmx1024m -XX:+UseG1GC -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -Xloggc:/tmp/gc.log -XX:+PrintAdaptiveSizePolicy I observe…
pauldoo
  • 18,087
  • 20
  • 94
  • 116
7
votes
1 answer

Why isn't -XX:+ExplicitGCInvokesConcurrent the default when using the G1 collector?

In the context of an in-memory database, we are using off-heap memory in conjunction to the G1 collector of hotspot. However, when off-heap memory usage reaches MaxDirectMemorySize, a full GC is triggered by the JDK code using System.gc(). This…
7
votes
1 answer

How to interpret G1 GC logs leading up to an OutOfMemoryError?

I was wondering if someone is able to explain to me how to interpret some G1 GC logs that lead up to an OutOfMemoryError? I know that a heap dump is the best bet for finding out what is actually using the heap but I can't get that since it contains…
steinybot
  • 5,491
  • 6
  • 37
  • 55
7
votes
1 answer

Does allocation performance degrade on a large number of live instances when using G1?

While moving from CMS to G1 for some of our applications, I noticed that one of them suffered from a startup time extended by factor 4. Application stop time due to GC cycles is not the cause. On comparing application behaviour, I disovered that…
malamut
  • 456
  • 4
  • 12
7
votes
1 answer

GC pauses get really long after several days

I am running a build system. We used to use CMS collector, but we started suffering under very long full GC cycles, throughput (time not doing GC) was around 90%. So I now decided to switch to G1 with the assumtion that even if I have longer overall…
Erki M.
  • 5,022
  • 1
  • 48
  • 74
7
votes
2 answers

Class Unloading in Java's G1 Garbage Collector (G1GC)

In Java 6 we used to use the following GC configuration to prevent Perm Gen OutOfMemoryException after several redeployments of our app: -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled We're moving to Java 7 and want to use the new G1 GC,…
Andres Olarte
  • 4,380
  • 3
  • 24
  • 45
1 2
3
20 21