What is the use of MetaSpace in Java 8?

I know they have replaced PermGen with MetaSpace in Java 8. But I have few questions: Is MetaSpace by default is GC collected? Even the PermGen is GC collected by adding the args like -XX:+CMSClassUnloadingEnabled , then what makes MetaSpace better than PermGen? MetaSpace is based on native memory, so it keeps the java objects on the disks rather than on VM? Even MetaSpace can run out of

在Java 8中使用MetaSpace有什么用?

我知道他们已经用Java 8中的MetaSpace取代了PermGen。但我有几个问题: 默认情况下,MetaSpace是否收集了GC? 即使是PermGen也是通过添加如-XX:+CMSClassUnloadingEnabled类的参数来收集GC,那么是什么让MetaSpace比PermGen更好? MetaSpace基于本机内存,因此它将Java对象保留在磁盘上而不是VM上? 即使MetaSpace可能会耗尽内存? 如果是这样,我会得到OutOfMemoryException 。 默认情况下,MetaSpace可以增加内存?

XX:MaxPermSize with or without

We've run into a Java.lang.OutOfMemoryError: PermGen space error and looking at the tomcat JVM params, other than the -Xms and -Xmx params we also specify -XX:MaxPermSize=128m . After a bit of profiling I can see occasionally garbage collection happening on the PermGen space saving it from running full. My question is: other than increasing the -XX:MaxPermSize what would be the difference

XX:MaxPermSize有或没有

我们碰到的一个Java.lang.OutOfMemoryError:PermGen space的错误,看着Tomcat的JVM参数,可以比其他-Xms和-Xmx PARAMS我们还指定-XX:MaxPermSize=128m 。 经过一番分析后,我可以偶尔看到在PermGen空间中发生的垃圾收集,从而使其无法运行。 我的问题是:除了增加-XX:MaxPermSize ,如果我指定了-XX:PermSize什么-XX:PermSize ? 我知道总的内存中,然后将XMX + MaxPermSize参数 ,但是否有其他原因-XX:PermSize时, 不应有

PermGen elimination in JDK 8

I have installed JDK 8 and trying to run Eclipse. I am getting following warning message: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0 What are the reasons of ignoring this argument? This is one of the new features of Java 8, part of JDK Enhancement Proposals 122: Remove the permanent generation from the Hotspot JVM and thus the n

在JDK 8中删除PermGen

我已经安装了JDK 8并尝试运行Eclipse。 我收到以下警告消息: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0 忽略这个论点的原因是什么? 这是Java 8的新功能之一,是JDK增强建议122的一部分: 从热点JVM中删除永久代,因此需要调整永久代的大小。 将包含在Java 8中的所有JEP的列表可以在JDK8里程碑页面上找到。 忽略这些争论的原因是永久代在JDK8的Ho

Java heap terminology: young, old and permanent generations?

I'm trying to understand how the concepts of young, old and permanent generations in the Java heap terminology, and more specifically the interactions between the three generations. My questions are: What is the young generation? What is the old generation? What is the permanent generation? How does the three generations interact/relate to each other? This seems like a common misu

Java堆术语:年轻的,老的和永久的世代?

我试图理解Java堆术语中年轻,老年和永久代的概念,更具体地说是三代人之间的相互作用。 我的问题是: 年轻一代是什么? 老一代是什么? 永久的一代是什么? 三代人如何互相交流/相互关联? 这似乎是一个常见的误解。 在Oracle的JVM中,永久代不是堆的一部分。 它是类定义和相关数据的独立空间。 在Java 6及更早版本中,interned字符串也存储在永久代中。 在Java 7中,interned字符串存储在主对象堆中。 这是

How is an object stored in heap?

How exactly an object is stored in heap. For example, a bicycle class can be defined like this: public class Bicycle { public int gear; public int speed; public Bicycle(int startSpeed, int startGear) { gear = startGear; speed = startSpeed; } public void setGear(int newValue) { gear = newValue; } public void applyBrake(int decrement) { speed

对象如何存储在堆中?

一个对象如何存储在堆中。 例如,可以像这样定义自行车类: public class Bicycle { public int gear; public int speed; public Bicycle(int startSpeed, int startGear) { gear = startGear; speed = startSpeed; } public void setGear(int newValue) { gear = newValue; } public void applyBrake(int decrement) { speed -= decrement; } public void speed

Is the heap actually a heap?

Possible Duplicates: Why are two different concepts both called “heap”? What's the relationship between “a” heap and “the” heap? In .NET (and Java as far as I know), the area where objects are dynamically allocated is referred to as the managed heap. However, most documentation that describes how the managed heap works depicts it as a linear data structure, such as a linked list or sta

这堆实际上是一堆吗?

可能重复: 为什么两个不同的概念都被称为“堆”? “堆”和“堆”之间的关系是什么? 在.NET(和我所知的Java)中,动态分配对象的区域称为托管堆。 但是,大多数描述托管堆工作原理的文档都将其描述为线性数据结构,例如链接列表或堆栈。 那么,托管堆实际上是一堆,还是与其他一些数据结构一起实现呢? 如果它实际上不使用堆数据结构,似乎是一个术语的重大故障,以超载这个词的含义。 如果它实际上是一个堆数据结构,

Where is allocated variable reference, in stack or in the heap?

I have a question What happend when I declare a variable inside a method, for example. void myMethod() { Ship myShip = new Ship(); } Where is allocated myShip reference, in stack or in the heap ? I think in stack but I'm confused because I was reading in J2ME Game Programming book "Java classes are instantiated onto the Java heap" All java clases ? Thanks in advance

哪里分配了变量引用,堆栈还是堆?

我有个问题 例如,当我在一个方法中声明一个变量时会发生什么。 void myMethod() { Ship myShip = new Ship(); } 哪里分配了myShip参考,堆栈中还是堆中? 我认为在堆栈中,但我很困惑,因为我在阅读J2ME游戏编程书“Java类被实例化到Java堆” 所有的java clases? 提前致谢 myShip是对Ship对象的引用, myShip位于方法调用堆栈上,称为“堆栈”。 当一个方法被调用时,一个内存块被压入堆栈顶部,该内存块为所有

Why is the default size of PermGen so small?

What would be the purpose of limiting the size of the Permgen space on a Java JVM? Why not always set it equal to the max heap size? Why does Java default to such a small number of 64MB? Are they trying to force people to notice permgen issues in their code by doing this? If my app uses 85MB of permgen, then it might be safe to set it to 96MB but why set it so small if its just really part o

为什么PermGen的默认大小如此之小?

限制Java JVM上Permgen空间大小的目的是什么? 为什么不总是将其设置为最大堆大小? 为什么Java默认为64MB这样一小部分? 他们是否试图通过这样做来强迫人们注意代码中的permgen问题? 如果我的应用使用85MB的permgen,那么将它设置为96MB可能是安全的,但为什么将它设置得如此之小以至于它只是主堆的真正一部分? 让JVM能够像堆一样使用PermGen不是很有效吗? 从概念上讲,对于程序员来说,你可能会认为“永久代”基本上

Is java PermGen space part of the total VM memory?

Assuming I start my java VM with the following parameters: -Xms1024m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m Do the 512m PermGen space add to the 1024m memory or are they part of it ? Or in other words, do I have a total memory consumption of 1536m or of 1024m? In the latter case, does that mean that the application has only 512m for purposes other than PermGen space? Please let me

Java PermGen空间是整个虚拟机内存的一部分吗?

假设我用以下参数启动我的Java VM: -Xms1024m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m 512m PermGen空间是否可以加入 1024m内存,还是它们的一部分 ? 换句话说,我的内存消耗量是1536米还是1024米? 在后一种情况下,这是否意味着除了PermGen空间之外,应用程序仅有512m用途? 请让我知道,如果这个问题揭示了PermGen空间的缺乏理解。 ;-) -Xms和-Xmx参数指向堆内存,而PermGen空间是独立的内存池。 换

Why does G1 Old gen max memory in jmx equal to max heap size?

I start a tomcat instance enabled with jmx, I check G1 old gen memory stat, find max memory = max heap size. The environment # uname -a Linux bogon 2.6.32-642.15.1.el6.x86_64 #1 SMP Fri Feb 24 14:31:22 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux # cat /etc/redhat-release CentOS release 6.8 (Final) # java -version java version "1.8.0_65" Java(TM) SE Runtime Environment (build 1.8.0_65-b17) Java Hot

为什么G1在jmx中的旧gen最大内存等于最大堆大小?

我启动了一个启用了jmx的tomcat实例,我检查了G1旧的内存统计信息,找到最大内存=最大堆大小。 环境 # uname -a Linux bogon 2.6.32-642.15.1.el6.x86_64 #1 SMP Fri Feb 24 14:31:22 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux # cat /etc/redhat-release CentOS release 6.8 (Final) # java -version java version "1.8.0_65" Java(TM) SE Runtime Environment (build 1.8.0_65-b17) Java HotSpot(TM) 64-Bit Server VM (buil