English 中文(简体)
贾瓦进程记忆的使用远远超过了追随时间。 总数 记忆和其他方法正在显示
原标题:Java process memory usage much more than what Runtime.totalMemory et al methods are telling

长期以来,我一直毫不犹豫地处理这个问题。 如果有人能提供帮助,将真心感激。

我正在对ARM v7加工器的装置申请 Java。 它已经安装在乌班图。 在使用“站式”或“免费――m”指挥器时,对这一过程的记忆使用大约为180 甲基溴,远远大于“运行时间”。 免费 记忆和其他方法告诉我。

这是我开始申请的:

java -Xcheck:jni -XX:MaxPermSize=25m -Xmx65m -XX:ReservedCodeCacheSize=10m -jar MyAPP.jar myconfig.xml

据我所知,这一过程的总记忆使用不应穿过25 + 65 + 10 = 100 MB。 它可能比较少(我不知道其他非肥皂空间)。 但即便如此,我也认为这一区别应当如此之大(80%的甲基溴)。

这就是我的记录中“兼职”指挥似乎告诉我的情况(我利用这些指挥来印刷用胎儿,作为我的假日记录的一部分)。

Usage Information: Avaable processors: 2 免费传承:8474344,经常记忆使用: 5943576, 最大传记: 66977792

“站”产出:

PID   USER     PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
3926  linaro   20  0   266m  188m 3636 S  1.0 21.1   0:37.81 java

“自由――m”的产出:

Java进程运行时:

        total       used       free     shared    buffers     cached
Mem:     893         842         51          0         40        216
-/+ buffers/cache:   585        308
Swap:     0          0          0

程序停止后:

         total      used       free     shared    buffers     cached
Mem:      893        656        237          0         40        216
-/+ buffers/cache:   400        493
Swap:      0          0          0

我们可以看到,493 - 308=185,正与“站起来”的说法相对应(我认为,在这个机器上安装了顶顶端的灯泡)。

我对这一进程也进行了远程监测,这表明“混合”的肥皂面积约为14M,而大约为20M。 至少,肥皂空间与我从“平时”指挥的距离相吻合。 因此,即使是遥远的监测工具似乎也说,记忆的使用远远少于180M。

最奇怪的部分是,在我用手提电脑(MacBook Pro)或标准英特尔公司(而不是ARM)箱(而不是ARM)操作时,似乎也存在同样的jar。 工艺只使用大约60个甲基溴,这是我所期望的。

另一个值得提及的是,在ARM装置上使用的是Java SE 带刺版是Oracle。

任何人对记忆使用中的这种差异有想法。 要求提出这样一个长期问题:-。

最新资料:

After doing some research about the various parts of a Java process which can consume memory, I zeroed down on native code interaction (JNI). That is the only guy whose memory consumption we can not limit from command live arguments. In my program I am using sqlite-jdbc driver to access database. I commented the database access part and memory usage came down to 24MB!!! So I am guessing that this memory discrepancy has something to do with this sqlite jdbc access, though not yet sure what it is. Will keep updating as I make some progress.

- Sande

问题回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签