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

Is -XX:+UseG1GC the correct replacement for -Xincgc?

Currently, we are using the incremental garbage collector by adding -Xincgc to the java command. In JDK 8 this switch is deprecated. So what's the equivalent replacement for it? -XX:+UseG1GC? Background: The application has a heap of 8GB and creates…
BetaRide
  • 16,207
  • 29
  • 99
  • 177
15
votes
2 answers

Why does G1GC shrink the young generation before starting mixed collections?

When G1 decides it needs to start doing mixed collections, it aggressively shrinks our Eden space from 10g to about 1g. {Heap before GC invocations=294 (full 0): garbage-first heap total 20480000K, used 18304860K [0x00000002de000000,…
Savior
  • 3,225
  • 4
  • 24
  • 48
15
votes
2 answers

Why is G1 Full GC being triggered seeminly unnecessarily?

I am using java version "1.7.0_09" Java(TM) SE Runtime Environment (build 1.7.0_09-b05) Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode) with G1 garbage collector. JVM argumens are -server -Xss4096k -XX:MaxPermSize=512m…
Martin
  • 1,385
  • 15
  • 21
14
votes
1 answer

Why doesn't G1 start a marking cycle when the InitiatingHeapOccupancyPercent is achieved?

According to the documentation, XX:InitiatingHeapOccupancyPercent Sets the Java heap occupancy threshold that triggers a marking cycle. The default occupancy is 45 percent of the entire Java heap. In my current environment, that does not…
Savior
  • 3,225
  • 4
  • 24
  • 48
14
votes
1 answer

What causes the G1 garbage collector in Java 7 to abort its concurrent-mark phase?

I've noticed occasional full GC's in my application using the G1 garbage collector, and am trying to figure out why they happen. The cycle from one region-scan-start to the next is excerpted below. At 61807.406, a full GC is logged, followed by an…
sharakan
  • 6,821
  • 1
  • 34
  • 61
12
votes
1 answer

What causes long spin and sync times in Java?

In Java 8 Update 45, adding these options to the java call: -XX:+PrintGCApplicationStoppedTime -XX:+PrintSafepointStatistics -XX:PrintSafepointStatisticsCount=1 shows me statistics like these: vmop [threads: total initially_running wait_to_block]…
malamut
  • 456
  • 4
  • 12
11
votes
2 answers

Why G1 is default garbage collector for Java 9?

Till Java 8, we have seen Parallel GC as default garbage collector but the recent release of Java (Java 9) came up with G1 GC as default garbage collector. Why has Java moved to G1 GC ? Is there any performance improvement ?
Sujeet U
  • 163
  • 2
  • 2
  • 11
11
votes
4 answers

G1: What are the differences between mixed gc and full gc?

For garbage first collector, young gc means performing gc in young generation only and mixed gc would clean both young and old generation. So what is full gc? Why it lasts longer than mixed gc? I've done some searching but I didn't find any post…
Neo
  • 2,196
  • 5
  • 32
  • 58
11
votes
2 answers

Java G1 GC Processing Reference objects works slow

I have hit counter running on Java. It works 24 hours and hits pass at about 100 times per second. During the day GC processing time slowly rises from 20-60 ms till 10000-60000 ms and then drops to 20-60 ms. Such pattern is repeated from time to…
gorbunak
  • 141
  • 9
10
votes
2 answers

What is the difference between G1GC options -XX:ParallelGCThreads vs -XX:ConcGCThreads

when configuring the G1GC we have 2 kinds of thread count -XX:ParallelGCThreads and -XX:ConcGCThreads what is the difference, how they are going to impact, any reference is appreciated.
RamiReddy P
  • 1,628
  • 1
  • 18
  • 29
10
votes
1 answer

VisualVM shows double Xmx as Max Heap Size

I have the following problem: There is a Java VM with Xmx Option set to 70000m = 70GB (Yes, it is that big). But if I monitor the before mentioned JVM, Max Heap is shown as 140000m (as seen in the screenshot). Following a listing of used JVM…
dRoeder
  • 153
  • 1
  • 8
9
votes
1 answer

Does G1GC release back memory to the OS even if Xms = Xmx?

After reading some answers like this and JEP-346, I have realised that the G1 does release memory back to the OS. However does it release memory back to the OS, even to the point that current memory use can drop below the initial heap memory (i.e…
Adwait Kumar
  • 1,552
  • 10
  • 25
9
votes
6 answers

Why String Deduplication when we have String Pool

String De-duplication: Strings consume a lot of memory in any application.Whenever the garbage collector visits String objects it takes note of the char arrays. It takes their hash value and stores it alongside with a weak reference to the array.…
user3778137
9
votes
3 answers

Zero-garbage large String deserialization in Java, Humongous object issue

I am looking for a way to deserialize a String from a byte[] in Java with as little garbage produced as possible. Because I am creating my own serializer and de-serializer, I have complete freedom to implement any solution on the server-side (i.e.…
SergioTCG
  • 101
  • 4
8
votes
3 answers

Experience with JDK 1.6.x G1 ("Garbage First")

I'd like to know what are the experiences with G1 garbage collector in newest JDK? I see NullPointerException thrown in my program, although code didn't change and behave correctly in earlier JDKs.
Roman Kagan
  • 10,440
  • 26
  • 86
  • 126
1
2
3
20 21