Java应用程序是否可以分配比jvm启动参数指定的内存更多的内存? [英] Can a java application allocate more memory than specified by jvm startup parameters?

查看:289
本文介绍了Java应用程序是否可以分配比jvm启动参数指定的内存更多的内存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假定Java应用程序未使用任何本机库. 有没有一种方法可以分配比jvm启动参数指定的更多的内存?

Assuming a java application is not using any native libraries. Is there a way that it anyway can allocate more memory than specified by jvm startup parameters?

反过来说:我可以依靠Java应用程序分配的内存永远不会超过JVM启动参数所限制的内存吗?

Asking the other way round: Can I rely that a java application will never allocate more memory than restricted by JVM startup parameters?

推荐答案

实际上,您总是需要比启动脚本中指定的-Xmx更多的内存. GC内部,JIT优化表,堆外分配,permgen,线程堆栈等都在付出代价.

Indeed, you always need more memory than the -Xmx specified in your startup script. GC internals, JIT optimization tables, off heap allocations, permgen, thread stacks, etc are all taking their toll.

这篇关于Java应用程序是否可以分配比jvm启动参数指定的内存更多的内存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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