Java VM - does the freed memory return to the OS?(Java VM - 释放的内存是否返回到操作系统?)
问题描述
在 Java 运行时,如果我的应用程序释放内存,运行时是否会将内存释放回操作系统?还是回到我的流程?
In the Java runtime, if my application frees memory, does the runtime release the memory back to the OS? Or just back to my process?
推荐答案
这取决于JVM实现,规范中没有指定.
That depends on the JVM implementation and isn't specified in the specification.
Sun JVM 将保留它作为第一步.一旦分配的内存的某个(可配置)百分比未使用,它会将其中的一部分返回给操作系统(该行为受 MinHeapFreeRatio
和 MaxHeapFreeRatio
设置).
The Sun JVM will hold onto it as a first step. Once a certain (configurable) percentage of allocated memory is unused, it will return some of it to the OS (the behavior is influenced by the MinHeapFreeRatio
and MaxHeapFreeRatio
settings).
这篇关于Java VM - 释放的内存是否返回到操作系统?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Java VM - 释放的内存是否返回到操作系统?


基础教程推荐
- 验证是否调用了所有 getter 方法 2022-01-01
- 在 Java 中创建日期的正确方法是什么? 2022-01-01
- 大摇大摆的枚举 2022-01-01
- 多个组件的复杂布局 2022-01-01
- 不推荐使用 Api 注释的描述 2022-01-01
- Java 实例变量在两个语句中声明和初始化 2022-01-01
- Java Swing计时器未清除 2022-01-01
- 如何在 JFrame 中覆盖 windowsClosing 事件 2022-01-01
- 从 python 访问 JVM 2022-01-01
- 如何在 Spring @Value 注解中正确指定默认值? 2022-01-01