[英]Native memory usage in Linux seems to be much higher than observed through JVM itself (e.g. through JConsole)
We have a customer that uses WebSphere 7.0 on RedHat Linux Server 5.6 (Tikanga) with IBM JVM 1.6. 我们有一个客户在IBM JVM 1.6的RedHat Linux Server 5.6(Tikanga)上使用WebSphere 7.0。 When we look at the OS reports for memory usage, we see very high numbers and OS starts to use SWAP memory in some point due to lack in memory. 当我们查看操作系统报告中的内存使用情况时,我们看到数量非常高,并且由于内存不足,操作系统在某些时候开始使用SWAP内存。 On the other hand, JConsole graphs show perfectly normal behavior of memory - Heap size increases until GC is invoked when expected and Heap size drops to ~30% in normal cycles. 另一方面,JConsole图完美地显示了内存的正常行为-堆大小增加,直到在预期的时候调用GC为止,并且在正常周期中堆大小下降到〜30%。 Non heap is as expected and very constant in size. 非堆是预期的,并且大小非常恒定。
Does anyone have an idea what this extra native memory usage can be attributed to? 有谁知道这个额外的本机内存使用量可以归因于什么?
I would check you are looking at resident memory and not virtual memory (the later can be very high) 我会检查您正在查看驻留内存,而不是虚拟内存(后者可能很高)
If you swap, even slightly this can cause the JVM to halt for very long periods of time on a GC. 如果交换,即使稍微交换,这也可能导致JVM在GC上停顿很长时间。 If your application is not locking up for second or minutes, it probably isn't swapping (another program could be) 如果您的应用程序没有锁定第二或几分钟,则可能是没有交换(可能是另一个程序)
If your program really is using native memory, this will most like be due to a native library you have imported. 如果您的程序确实在使用本机内存,则最可能是由于您导入了本机库。 If you have a look at /proc/{id}/mmap this may give you a clue, but more likely to will have to check which native libraries you are loading. 如果您查看/ proc / {id} / mmap,这可能会给您一个线索,但更有可能必须检查您正在加载的本机库。
Note: if you have lots of threads, the stack space for all these reads can add up. 注意:如果您有很多线程,则所有这些读取的堆栈空间可能会累加。 I would try to keep these to a minimum if you can, but I have seen JVMs with many thousands and this can chew up native memory. 如果可以的话,我会尽量减少这些,但是我看到JVM有成千上万个,这会占用本机内存。 GUI components can also use native memory but I assume you don't have any of those. GUI组件也可以使用本机内存,但我假设您没有任何这些。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.