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
323
votes
16 answers

java.lang.OutOfMemoryError: GC overhead limit exceeded

I am getting this error in a program that creates several (hundreds of thousands) HashMap objects with a few (15-20) text entries each. These Strings have all to be collected (without breaking up into smaller amounts) before being submitted to a…
PNS
  • 19,295
  • 32
  • 96
  • 143
92
votes
16 answers

Java G1 garbage collection in production

Since Java 7 is going to use the new G1 garbage collection by default is Java going to be able to handle an order of magnitude larger heap without supposed "devastating" GC pause times? Has anybody actually implemented G1 in production, what were…
benstpierre
  • 32,833
  • 51
  • 177
  • 288
82
votes
8 answers

Java 7 (JDK 7) garbage collection and documentation on G1

Java 7 has been out for a while now, but I cannot find any good resources on the configuration of the garbage collectors, specifically the new G1 collector. My questions: Is G1 the default collector in Java 7 and if not how do I activate G1? What…
Florakel
  • 1,131
  • 1
  • 10
  • 8
48
votes
3 answers

How does the Garbage-First Garbage Collector work?

Can someone explain how the G1 Garbage Collector works please? I haven't been able to find any comprehensive, easy-to-understand descriptions anywhere yet. Thanks
dogbane
  • 266,786
  • 75
  • 396
  • 414
46
votes
1 answer

Why there is performance degradation after ~6 hours of Java 9 G1 work without the actual increase in load?

I switched 1 instance (2 vCPU, 2GB RAM, load ~4k req/sec) to Java 9 (from latest Java 8). For a while, everything was fine and CPU usage was same as before. However, after ~6 hours CPU consumption increased by 4% (from 21% to 25%) for no reason. I…
Dmitriy Dumanskiy
  • 11,657
  • 9
  • 37
  • 57
34
votes
1 answer

JVM G1GC's mixed gc not collecting much old regions

My server is using 1.8.0_92 on CentOS 6.7, GC param is '-Xms16g -Xmx16g -XX:+UseG1GC'. So the default InitiatingHeapOccupancyPercent is 45, G1HeapWastePercent is 5 and G1MixedGCLiveThresholdPercent is 85. My server's mixed GC starts from 7.2GB, but…
koji lin
  • 667
  • 1
  • 8
  • 12
30
votes
5 answers

G1 garbage collector: Perm Gen fills up indefinitely until a Full GC is performed

We have a fairly big application running on a JBoss 7 application server. In the past, we were using ParallelGC but it was giving us trouble in some servers where the heap was large (5 GB or more) and usually nearly filled up, we would get very long…
Jose Otavio
  • 303
  • 1
  • 3
  • 6
29
votes
6 answers

Is G1GC still not officially production ready?

I wonder what the official status of the "garbage first" (G1) collector in the JDK 7 release is. I would like to use G1 as a low pause gc alternative to CMS, but only if I can really trust on its robustness. Before JDK 7 was out, G1 was advertised…
Gerald Thaler
  • 569
  • 1
  • 5
  • 8
28
votes
4 answers

UseConcMarkSweepGC vs UseParallelGC

I'm currently having problems with very long garbage collection times. please see the followig. My current setup is that I'm using a -Xms1g and -Xmx3g. my application is using java 1.4.2. I don't have any garbage collection flags set. by the looks…
grassbl8d
  • 2,089
  • 4
  • 24
  • 34
19
votes
3 answers

Can someone make sense of the G1 garbage collector output?

I am running a Java program with the G1 garbage collector using the following options: -XX:-UseBiasedLocking -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -verbose:gc -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -Xloggc:/var/tmp/gclog.out The…
oxbow_lakes
  • 133,303
  • 56
  • 317
  • 449
16
votes
1 answer

-XX:G1ReservePercent and to-space exhausted

I'm trying to understand what the -XX:G1ReservePercent actually does. The descriptions I found in the official documentation are not really comprehensive: Sets the percentage of reserve memory to keep free so as to reduce the risk of to-space…
St.Antario
  • 26,175
  • 41
  • 130
  • 318
16
votes
5 answers

How to know region size used of G1 garbage collector?

I'm currently looking into G1 GC in latest Java 8 version. I have issues with "Humongous Allocation" so I wanna know how big my region size is. How can I find out how big the region size is set? How can I calculate the region size myself? Thanks
keiki
  • 3,260
  • 3
  • 30
  • 38
16
votes
2 answers

Is String Deduplication feature of the G1 garbage collector enabled by default?

JEP 192: String Deduplication in G1 implemented in Java 8 Update 20 added the new String deduplication feature: Reduce the Java heap live-data set by enhancing the G1 garbage collector so that duplicate instances of String are automatically and…
Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154
16
votes
5 answers

Latencies issues which G1GC

I am facing a continues increase in GC pauses with G1GC algorithm. The service latencies continue to grow over time. Once this happens, I restart my service and the latencies go back to normal. Post startup, the latencies again continue to increase…
Santano
  • 161
  • 1
  • 6
16
votes
1 answer

Java G1: Monitoring for memory leaks in production

For years, we've been running Java services with modest heap sizes using +UseParallelOldGC. Now, we're starting to roll out a new service using a larger heap and the G1 collector. This is going pretty well. For our services that use…
user1896098
  • 161
  • 3
1
2 3
20 21