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?
In the Java runtime, if my application frees memory, does the runtime release the
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That depends on the JVM implementation and isn’t specified in the specification.
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
MinHeapFreeRatioandMaxHeapFreeRatiosettings).