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

58 questions
3
votes
1 answer

UseCompressedOops kick-in threshold different for G1 and CMS

I am running a 64 bit Java 1.8 Hotspot JVM by Oracle. I have been trying to wrap my head around a difference in behavior of JVM to kick in compressed object pointers when different GC mechanisms are used. For example: $ java -XX:+UseConcMarkSweepGC…
Ashu Pachauri
  • 1,283
  • 10
  • 16
3
votes
1 answer

Java 8: CMS does not kick on for old generation even though CMSInitiatingOccupancyFraction specified

I am running a Java WebApp using tomcat7 and JRE 1.8. The application caches huge amount of data (~15GB), and supports high throughput (~4K/sec). Due to high request rate, it generates large number of objects in the young generation, some of the…
Ameya
  • 83
  • 1
  • 9
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
  • 63
  • 1
  • 8
2
votes
2 answers

How can a jmap live heap dump contain unreachable objects?

I used jmap to dump the live heap of an application using CMS GC: jmap -dump:live,format=b,file=heap.hprof I opened this dump with YourKit and it found that 61% of the 8Gb heap was unreachable, specifically Objects unreachable from GC roots,…
Graeme Moss
  • 7,995
  • 4
  • 29
  • 42
2
votes
1 answer

It's this CMS gc caused by method System.gc()?

I have a code like this, it's very simple: public class Main { public static void main(String[] args) throws Exception { Thread.sleep(5000); System.gc(); } } and this is my JVM options: -XX:+ExplicitGCInvokesConcurrent…
Ryanqy
  • 8,476
  • 4
  • 17
  • 27
2
votes
1 answer

Why CMS is stop the world for Initial mark but not for sweeping phase?

There are 4 high level phases CMS works for full GC Initial mark :- Stop the world(STW) Concurrent marking :- Run concurrently Remark :- STW Concurrent sweeping:- Run concurrently I have got high level understanding of CMS after reading…
emilly
  • 10,060
  • 33
  • 97
  • 172
2
votes
1 answer

Why is CMS full GC single-threaded?

Whenever there's concurrent mode failure or promotion failure using CMS it does full GC using single thread. Why it couldn't do full GC using parallel collector to decrease the full GC penalty?
ZZ 5
  • 1,744
  • 26
  • 41
2
votes
1 answer

CMS collector not keeping pace with Old Gen

On a moderately busy production server (50 app threads, 30% CPU utilisation), we're seeing a scenario where the CMS collector doesn't keep pace with objects promoted into the old generation. My initial thoughts were that these objects were obviously…
Michael
  • 7,348
  • 10
  • 49
  • 86
2
votes
1 answer

How to use JVM parameters for web application running on tomcat, on linux machine

I want to use a different garbage collector than the default Parallel GC for my web application when deployed on my production server, which will be on linux. Say for an example i want to use Concurrent Mark Sweep GC for the application. Now i have…
Loui
  • 533
  • 17
  • 33
2
votes
1 answer

Java CMS GC, GC threads taking CPU when system is idle

We have a web application in tomcat 7, JDK 7, Amazon Linux. This is what we have for the GC configuration: -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled" We do not have "PrintGCDetails" enabled. This is what is printed out in the gc.log…
Khanna111
  • 3,627
  • 1
  • 23
  • 25
2
votes
1 answer

Object classes in concurrent-mark-sweep (CMS) unloading classes

Usually for CMS I will see the following stdout [Unloading class sun.reflect.GeneratedMethodAccessorXXX] [Unloading class sun.reflect.GeneratedConstructorAccessorXXXX] [Unloading class sun.reflect.GeneratedSerializationConstructorAccessorXXX]…
user4127
  • 2,397
  • 6
  • 21
  • 32
2
votes
1 answer

Conc Mark and Sweep Garbage Collector difference between java 1.6 and 1.7

I was using jdk 1.6 with CMS GC and when I tried to migrate to JDK 1.7, the heap usage increases and the process becomes slow. Is there a major difference in GC behavior in these versions? What is the workaround if it has become slower in JDK 1.7?
Rasesh
  • 307
  • 1
  • 4
  • 11
2
votes
2 answers

Why does CMS collector collect root references from young generation on Initial Mark phase?

As far as I know CMS collector collects old generation and it works in conjunction with ParNew collector (which is applied for collecting the young generation). It is not so easy for me to clearly understand how CMS works but here is how I saw…
Anton Kasianchuk
  • 1,177
  • 5
  • 13
  • 31
2
votes
1 answer

Is it ok to assume that the Java Concurrent Mark Sweep Garbage Collector is equally good on Linux and Mac as well as Windows?

I have been looking for information on the web regarding use of the Java Concurrent Mark Sweep GC for Linux and Mac or for different versions of Java. I'm specifically interested in the latest versions of Oracle Java 1.6 and 1.7. I'll assume that…
2
votes
2 answers

Why is JVM continously doing full gc while the Old Generation is only half full?

I am using jdk 1.7.0_09 on a CentOS 64-bit linux machine. The gc related vm args is -Xmx4g -Xmn2g -XX:SurvivorRatio=4 -XX:PermSize=128m -XX:MaxPermSize=128m -XX:InitialTenuringThreshold=15 -XX:CMSWaitDuration=50 -XX:MaxTenuringThreshold=15…