NIO memory mapped files and Linux Virtual Memory performance issues

Apurva Mehta amehta at linkedin.com
Mon Aug 19 13:04:05 PDT 2013


Hello,

We are using NIO FileChannels to memory map files in a JVM 1.6 environment on a RHEL6 system with a Linux-2.6.32.x kernel.

The Linux Virtual Memory system is performing pretty poorly for us. In particular, 'sar -B' on these machines reports elevated pgscand/s counts (in the millions of page scans per second) which correlate with severely degraded service latencies. Sar also reports virtual memory efficiency close to 0% most of the time.

Our systems have 48GB of physical memory. At peak, we have 2000 files each of size 10 MB (ie 20 GB total)  which are memory mapped via NIO File channels. We typically churn through 900x10MB (9GB) memory mapped files per day per host (ie. we map / flush / unmap 900 files per day).  Our Java heap size is 5GB.

I was wondering if anybody has seen similar issues using NIO file channels to memory map files to effectively have a large amount of off-heap memory?  Intuitively, Linux should not have a problem with this kind of memory usage, so we are investigating any potential issues with the NIO / JVM / Linux interaction, and if there is something we can tune.

Any thoughts would be most welcome!

Thanks,
Apurva


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/nio-discuss/attachments/20130819/d12a2961/attachment.html 


More information about the nio-discuss mailing list