开发者

Reconciling outputs of jconsole and top

开发者 https://www.devze.com 2023-04-07 03:11 出处:网络
I am trying to look at memory management in Java. I have a program that creates a large collection (~500MB). I run java without any special arguments. Once this collection goes out of scope, I invoke

I am trying to look at memory management in Java. I have a program that creates a large collection (~500MB). I run java without any special arguments. Once this collection goes out of scope, I invoke the garbage collector using System.gc(). From jconsole, I can see that the heap memory in use is dramatically reduced. The same cannot be said of the RES output of the top linux command开发者_如何学Python.

My only interpretation is that once the JVM gets hold of memory, it does not release it to the system as long as it is running. Is this correct?

0

精彩评论

暂无评论...
验证码 换一张
取 消