烫发空间与堆空间 [英] Perm space vs Heap space

查看:81
本文介绍了烫发空间与堆空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,Perm空间和堆空间之间有什么区别(JVM选择使用每个内存空间的内容和方式)?

First, What is the difference between Perm space and Heap space (What and how does the JVM choose to use each memory space)?

其次,但最重要的是,对于标准MVC类型的Java应用程序,建议采用什么样的比率?

Second, but most importantly, what sort of ratio would be recommended for a standard MVC type java application?

推荐答案

存储Java程序创建的所有对象。堆的内容由垃圾收集器监视,当您停止使用对象时(即,当没有更多对象的引用时),它会从堆中释放内存。

The heap stores all of the objects created by your Java program. The heap's contents is monitored by the garbage collector, which frees memory from the heap when you stop using an object (i.e. when there are no more references to the object.

这与堆栈形成对比,后者存储基本类型(如整数和字符),通常是局部变量和函数返回值。这些不是垃圾回收。

This is in contrast with the stack, which stores primitive types like ints and chars, and are typically local variables and function return values. These are not garbage collected.

烫发空间是指堆的特殊部分。请参阅此SO答案以获得解释:
什么是烫发空间?

The perm space refers to a special part of the heap. See this SO answer for an explanation: What is perm space?

这篇关于烫发空间与堆空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆