I've kind of asked this question before - What does JVM flag CMSClassUnloadingEnabled actually do? , but this time it's slightly different!

If I start a Java VM with the -XX:+CMSPermGenSweepingEnabled flag set, the following message is printed:

Please use CMSClassUnloadingEnabled in place of CMSPermGenSweepingEnabled in the future

The -XX:+CMSPermGenSweepingEnabled flag is often used to mitigate against PermGen OutOfMemory errors, however I have read elsewhere that people have found that by following the above advice they have still had these errors, but by sticking with -XX:+CMSPermGenSweepingEnabled as well as -XX:+CMSClassUnloadingEnabled their VM has stayed up longer between restarts.

Does -XX:+CMSClassUnloadingEnabled really supersede -XX:+CMSPermGenSweepingEnabled or is there still some benefit in having them both?

Thanks in advance

Rich ps: I know that the root cause of perm gen issues is still usually Classloader leaks, this is more about the message that the JVM produces if we use the above options.

From what I can tell, the only thing that the 1.6 JVM does with CMSPermGenSweepingEnabled is to print that message - it's not processed the way it is in 1.5. For CMSClassUnloadingEnabled to have any impact, UseConcMarkSweepGC must also be set.

Download the JDK source code (which includes hotspot) and inspect hotspot/src/share/vm/runtime/globals.hpp . CMSPermGenSweepingEnabled is present in 1.5 and absent in 1.6. In addition, the 1.6 version of hotspot/src/share/vm/runtime/arguments.cpp contains new code for printing the message. kschneid Sep 16 '10 at 14:11 this is helpful hvgotcodes Oct 19 '10 at 0:46 Ok looking to the jdk 1.6.23 source code didn't find any place of usage except globals.hpp where it is just set to false. So it is really used??? Sorry if i missed the place where it is used. user253202 Apr 13 '11 at 14:49 Rapid7 是全球领先的安全风险信息解决方案提供商,Rapid7 用来漏洞管理,漏洞扫描,漏洞评估和渗透测试。Rapid7 的安装风险智能解决方案包括集成的风险管理和渗透测试产品 Nexpose 和 Metasploit, 它们使您的机构能对安全威胁和风险形势,主动获得准确的情报以及可操作的情境信息。Rapid7 独一无二地定位于提供安全风险情报的闭环... 1. 前言 Concurrent Mark Sweep ( CMS ) 收集器是hotspot虚拟机中一款低延迟的并发型垃圾收集器。 CMS 垃圾收集器的关注点是:尽可能缩短垃圾收集时用户线程的停顿时间,停顿时间越短(低延迟)就是越适合与用户交互的程序,良好的响应速度能提升用户体验。 CMS 垃圾收集器 以获取最短回收停顿时间为目标,采用“标记-清除”算法,分 4 大步进行垃圾收集,其中初始标记和重新标记会 STW ,多数应用于互联网站或者 B/S 系统的服务器端上, JDK 9 被标记弃用, JDK 14 被删除,详 问题描述: Please use CMS Class Un loading Enab led in place of CMS PermGenSwee ping Enab led in the future 'unrecognized VM option ' Pr int GCApplicationStoppedTime Error: Could not create the Java Virtual Machine. 1 理论篇 1.1 多功能养鱼塘- JVM 内存       大鱼塘O(可分配内存): JVM 可以调度使用的总的内存数,这个数量受操作系统进程寻址范围、系统虚拟内存总数、系统物理内存总数、其他系统运行所占用的内存资源等因素的制约。     &amp 启动kafka的时候报错,查看错误log显示如下 Java HotSpot™ 64-Bit Server VM (25.152-b16) for linux-amd64 JRE (1.8.0_152-b16), built on Sep 14 2017 02:16:14 by “ java _re” with gcc 4.3.0 20080428 (Red Hat 4.3.0-8) Memory: 4...       原文链接:原文作者:Monica Beckwith  以下为本人翻译,仅用于交流学习,版权归原作者和InfoQ所有,转载注明出处,请不要用于商业用途 在 Java 虚拟机( JVM )内部, class 文件中包括类的版本、字段、方法、接口等描述信息,还有运行时常量池,用于存放编译器生成的各种字面量和符号引        垃圾回收是 Java 程序员了解最少的一部分。他们认为 Java 虚拟机接管了垃圾回收,因此没必要去担心内存的申请,分配等问题。但是随着应用越来越复杂,垃圾回收也越来越复杂,一旦垃圾回收变的复杂,应用的性能将会大打折扣。所以, Java 程序员了解垃圾回收的机制并且知道怎样解决“内存溢出”问题会有很大的益处。在 Java 中,有两个非常普遍的内存溢出问题。一个是堆内存溢出,另一个是持久代内存溢出...  前几天新装的机器,又遇到tomcat不能启动的问题了。这个问题以前也遇到过,就是8080端口被占用,如装了oracle后,oracle的xdb会占用8080端口。 可这回可不是这个问题了,我当时改了oracle的端口,可还是不行,后来又用tomcat5.0、5.5试,都不行,这可急坏我了,在网上搜也没有新的解决方法,怎么办呢?这时我突然想到我们公司的网络是使用代理的,是不是代理的问题 这段时间基本熟悉 java 语言基本语法包,类(内部,外部),整体结构跟c#还是有点差异,在接口,多态,抽象等几乎一致,唯一差异仅存在于关键字上。 在用了几天记事本熟悉代码上,昨天晚上就准备转想myEclipse上来,但同时在安装Tomcat的时候遇到了些问题,奇怪的是早上在公司安装一遍问题解决了。 所以问题原因猜测如下, 1.1.7版本 JDK 跟Tomcat兼容问题(这个问题) 2.安装的时候...