Java VM - 释放的内存是否返回到操作系统? [英] Java VM - does the freed memory return to the OS?

查看:32
本文介绍了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 将保留它作为第一步.一旦分配的内存的某个(可配置)百分比未使用,它会将其中的一部分返回给操作系统(该行为受 MinHeapFreeRatioMaxHeapFreeRatio 设置).

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 - 释放的内存是否返回到操作系统?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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