Java内存:Runtime.getRuntime()。maxMemory() [英] Java Memory : Runtime.getRuntime().maxMemory()

查看:175
本文介绍了Java内存:Runtime.getRuntime()。maxMemory()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Runtime.getRuntime().maxMemory() 

显示哪个内存?它是幸存者,伊甸园,老,永久吗?

shows which memory ? Is it Survivor , Eden , Old, Permanent ?

推荐答案

它是堆的最大大小。它松散地基于 -mx -Xmx 命令行参数,但由于我不明白的原因可以少了1-5%(它似乎没有完全相同)

It is the maximum size of the heap. It is loosely based on the -mx or -Xmx command line argument but for reasons I don't understand can be 1-5% less (It doesn't seem to be ever exactly the same)

这不包括的是perm gen,直接内存,内存映射文件,堆栈空间或共享库。

What this doesn't include is the perm gen, the direct memory, memory mapped files, stack spaces or shared libraries.

虽然它不包含所有东西,但它通常可用于大多数应用程序的总内存的80-90%。

While it doesn't include everything is it usually 80-90% the total memory usable for most applications.

这篇关于Java内存:Runtime.getRuntime()。maxMemory()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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