Java内存泄漏 - 在程序终止时清除? [英] Java memory leaks - Cleared upon program termination?
问题描述
这似乎是一个是或否的问题,我希望它能在某个地方得到解答,但我当然找不到它。 java中的内存泄漏并不像C或C ++这样的语言那样经常发生,但它们可能会发生。
This seems like a yes or no question, and I would have expected it to be answered somewhere but I certainly can't find it. Memory leaks in java don't happen as often as as say developing in a language like C or C++, but they can happen.
大多数操作系统将清除分配给它的内存程序的终止,除了共享内存等特定情况。当JVM退出时,这仍然是正确的吗?如果我无意中在Java中创建内存泄漏,它是由JVM还是Linux或Windows操作系统清除?
Most OS will clear memory allocated upon a program's termination, with exception to certain cases like shared memory. Is this still true for when the JVM exits? If I inadvertently create a memory leak in Java will it be cleared by either the JVM or a Linux or Windows OS?
推荐答案
是,JVM终止后,所有内存都将被释放。
Yes,all memory will be released after JVM terminated.
这篇关于Java内存泄漏 - 在程序终止时清除?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!