gpt4 book ai didi

java - Java的Runtime.maxMemory()什么时候会返回Long.MAX_VALUE?

转载 作者:太空宇宙 更新时间:2023-11-04 14:31:01 26 4
gpt4 key购买 nike

documentation for Java's Runtime class它指出:

Returns the maximum amount of memory that the Java virtual machine will attempt to use. If there is no inherent limit then the value Long.MAX_VALUE will be returned.

“没有固有限制”是什么意思?不会总是有最大堆大小吗?

最佳答案

所有这意味着规范不要求存在明确的上限。这必须反射(reflect)在API中,否则maxMemory()的API将与规范不一致。

关于java - Java的Runtime.maxMemory()什么时候会返回Long.MAX_VALUE?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26140978/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com