Questions tagged [concurrent-mark-sweep]

Concurrent-mark-sweep is a garbage collection algorithm, known for its use on the Java Virtual Machine, which can reduce stop-the-world times on machines with limited resources.

Concurrent-mark-sweep is a garbage collection algorithm, known for its use on the Java Virtual Machine, which can reduce stop-the-world times on machines with limited resources; this is an attempt to reduce response times related to GC activity.

However, it can result in fragmentation of the old generation, and can fall back to older methods. It is not efficient on large heaps, since the mark phase is dependent on the size of live objects, and the sweep phase can traverse the entire heap.

Under concurrent-mark-sweep, most garbage collection activity is performed concurrently, i.e., while the application threads are running, to keep garbage collection-induced pauses short. This is in contrast to a simple stop-the-world garbage collector which completely halts execution of the program to run a collection cycle.

To enable, use the JVM argument -XX:+UseConcMarkSweepGC .

Resources

56 questions
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
  • 1,989
  • 4
  • 22
  • 30
18
votes
2 answers

Using Concurrent Mark Sweep garbage collector with more than 120GB RAM

Has anyone managed to use the Concurrent Mark Sweep garbage collector (UseConcMarkSweepGC) in Hotspot with more than 120GB RAM? The JVM starts just fine if I set -ms and -mx to 120G, but if I set them to 130G, the JVM crashes on startup. The JVM…
Neil
  • 1,644
  • 1
  • 17
  • 29
14
votes
4 answers

Why concurrent mark and sweep (CMS) is not cleaning up the same amount of memory as Full GC?

I have a strange issue with one of my production machines. It hosts a Java application that does CMS (concurrent mark and sweep), but it cleans up just a small part of the old generation. I suspected a memory leak and tried a heap dump. But the Full…
dcernahoschi
  • 13,894
  • 5
  • 31
  • 55
14
votes
3 answers

Is Concurrent Mark Sweep (CMS) a stop the world event?

I see many unloading of classes and my entire system will hang during that period of time.. [Unloading class sun.reflect.GeneratedMethodAccessor117] [Unloading class sun.reflect.GeneratedConstructorAccessor1896] [Unloading class…
user4127
  • 2,199
  • 6
  • 17
  • 28
13
votes
1 answer

-XX:+UseConcMarkSweepGC (what is default young generation collector?)

As far as I know we can run JVM with the next options: -XX:+UseConcMarkSweepGC -XX:-UseParNewGC in this case we will have the Serial (DefNew) garbage collector for the young generation and the Concurrent Mark Sweep garbage collector for the old…
Anton Kasianchuk
  • 1,069
  • 4
  • 13
  • 27
12
votes
3 answers

JVM CMS Garbage Collecting Issues

I'm seeing the following symptoms on an application's GC log file with the Concurrent Mark-Sweep collector: 4031.248: [CMS-concurrent-preclean-start] 4031.250: [CMS-concurrent-preclean: 0.002/0.002 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]…
jlintz
  • 453
  • 3
  • 8
11
votes
1 answer

CMS garbage collector - when does it run?

I am confused about two parameters that may control when the CMS collector kicks in: MaxHeapFreeRatio (70% by default) CMSInitiatingOccupancyFraction (over 90% by default) What does each of those parameters mean, exactly? When does the collector…
Konrad Garus
  • 50,165
  • 42
  • 145
  • 220
10
votes
4 answers

Java ConcurrentMarkSweep garbage collector not removing all garbage

Short form: The CMS garbage collector appears to be failing to collect an ever-increasing amount of garbage; eventually, our JVM fills up, and the application becomes unresponsive. Forcing a GC via an external tool (JConsole or jmap -histo:live)…
Sbodd
  • 10,779
  • 5
  • 38
  • 42
7
votes
2 answers

Avoiding promotion failed in Java CMS GC

I have a Java application using CMS garbage collection that suffers from a "ParNew (promotion failed)" full GC a few times every day (see below for an example). I understand that a promotion failure occurs when garbage collection cannot find enough…
Graeme Moss
  • 6,955
  • 4
  • 25
  • 39
5
votes
1 answer

Could increase gc time short lived object that has references to old lived object?

I need some clarification about how minor gc collections behave. calling a() or calling b() in a long-lived application, if they could behave worstly when old space gets bigger //an example instance lives all application life cycle 24x7 public…
nachokk
  • 14,055
  • 4
  • 22
  • 47
4
votes
2 answers

When would anyone use a single thread with the CMS Garbage Collector on a multi-core machine?

I am running an Apache Storm topology on a server using a Java 7 JVM. I've been considering some JVM tuning and noticed it is currently using a Concurrent Mark and Sweep (CMS) garbage collector. This makes sense, as the server has 32 cores and…
BlackVegetable
  • 10,734
  • 6
  • 45
  • 73
3
votes
1 answer

How do I record and graph the object lifetime for Java applications?

We want to tune the memory generation pool sizes for our Java application. In order to this we need to first understand how the heap is used. In essence we need to know number, size and lifetime for every object in the JVM heap. After we have…
3
votes
3 answers

Minor GC and full GC at the same time?

Here is a piece of GC logs that shows a full CMS GC event: 2016-12-29T22:44:34.741-0500: 27572.982: [GC (CMS Initial Mark) [1 CMS-initial-mark: 2508212K(23068672K)] 2931097K(26843584K), 0.0213349 secs] [Times: user=0.22 sys=0.00, real=0.02 secs]…
benji
  • 2,026
  • 5
  • 25
  • 51
3
votes
1 answer

Why JVM CMS(concurrent mark-and-sweep) needs two pauses for GC?

I wonder why CMS needs two phases (and so two pauses) of marks: i.e. initial mark and remark. Can we simply do one mark and then perform sweep? I imagine this can be a faster pause. Can someone help explain what is the main purpose of the second…
yuyang
  • 1,189
  • 1
  • 11
  • 31
3
votes
1 answer

Java GC CMS Collector Times

We have enabled garbage collection logs for our application. I see some lines where it prints the time of some of the CMS steps. Can anyone explain or point me to some link which explains CMS logs like 9657.238: [CMS-concurrent-mark: 17.199/17.396…
rontu
  • 53
  • 1
  • 7
1
2 3 4