JVM内存:为什么任务管理器上的内存与JProbe(或JConsole工具)不同 [英] JVM Memory : Why memory on task manager difference with JProbe (or JConsole tool)

查看:709
本文介绍了JVM内存:为什么任务管理器上的内存与JProbe(或JConsole工具)不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到的问题是我的应用程序使用的内存只有100MB,之后减少了50MB,但是在Window Task Manager上显示150MB并且始终保持或增加但不减少,
我们如何减少内存(私有)任务管理器上的工作集?

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 ?

推荐答案

您在 JConsole中看到的内容(或其他监视工具)是使用java内存的模式。

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

JVM的内存通常分为这些区域(您还可以在监视工具中看到)。

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


  1. 用于Java对象的堆内存

  2. 非堆内存,这是java的地方store加载类
    和元数据以及JVM代码

  3. 本机内存,它是为dll和
    本机代码(非常低级别)保留的内存的一部分。有时你可以在这个区域获得一个OOM
    ,同时你有足够的堆内存(因为当你
    增加 Max Heap 大小时,它会减少本机内存
    可用)。

  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).

Windows任务管理器没有显示。它显示了应用程序使用的整个内存(堆+非堆+本机部分)。

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

另请注意,通常是从OS请求更多内存的进程,即使实际应用程序释放内存,它也会保留此内存。这些内存页面已映射为进程的地址空间的一部分。所以在你的任务管理器中,你不会看到减少内存的模式,但这并不表示你的应用程序有一些内存泄漏。

所以你不能减少你从任务管理器看到的内存而是内存你从监视工具看,应该在某个时候减少,否则可能表示内存泄漏

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

这篇关于JVM内存:为什么任务管理器上的内存与JProbe(或JConsole工具)不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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