JVM Memory : Why memory on task manager difference with JProbe (or JConsole tool)

走远了吗. 提交于 2019-12-20 12:36:25

问题


The problem that I faced is my application's memory used is only 100MB after that it decreased 50MB, but on Window Task Manager it showed 150MB and always keep or increase but not decrease, How can we reduce Memory (Private working set) on task manager ?


回答1:


What you are seeing in JConsole (or other monitoring tools) is the pattern the java memory is being used.

The memory of the JVM is usually divided among these areas (what you also see in monitoring tools).

  1. Heap memory which is for Java objects
  2. Non-heap memory which is the place where java stores loaded classes and metadata and the JVM code
  3. Native memory which is a part of memory reserved for dll's and native code of Java (very low level). Sometimes you could get a OOM in this area while you got enough heap memory (because as you increase the Max Heap size, it reduces the native memory available).

The windows task manager does not show that. It shows the whole memory used by your application (heap + non-heap+ native part).

Also note that usually processes that request more memory from OS, this memory is kept by them even when the actual application "frees" memory. These memory pages have been mapped as part of the processe's address space. So in your Task Manager you would not see a pattern of decreasing memory, but that would not indicate some memory leak from your application.
So you can not reduce the memory you see from task manager but the memory you see from the monitoring tool should decrease at some point, otherwise that could indicate a memory leak



来源:https://stackoverflow.com/questions/12017437/jvm-memory-why-memory-on-task-manager-difference-with-jprobe-or-jconsole-tool

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!