On 10/10/2018 11:33 PM, Sourav Moitra wrote:
Hello Shawn,

Thanks for quick reply.
Where precisely are you seeing the 98% usage?
On the Solr web UI. Although the same Solr UI is reporting heap usage
to be below 1 GB.
Also I found that Solr Java is holding(VIRT) 8GB of total memory even
with Xmx set to 2g using top command.

On the "top" screen, you can see how much memory the process is using by subtracting the value in the SHR column from the value in the RES column.

The VIRT column does not indicate actual memory usage.  It tells you how much *VIRTUAL* memory the process has allocated within the processor's memory mapping system.  Usually, most of this value is *not* consuming actual RAM.

Here's a screenshot of a "top" running on a Solr system with over 700GB of index data:

https://www.dropbox.com/s/85h1weuopa643za/bigindy5-top-small-shr.png?dl=0

The VIRT column says over three quarters of a terabyte ... but the system has only 64GB of memory, 28GB of which is allocated to the Solr heap.  I can guarantee you that when this screenshot was taken, the system was NOT having memory problems.  If the VIRT column indicated actual memory consumption, that would be a completely impossible situation -- the machine doesn't HAVE that much memory!

Additional reading on the topic of virtual memory as it relates to Lucene/Solr:

http://blog.thetaphi.de/2012/07/use-lucenes-mmapdirectory-on-64bit.html

On your system, I can pretty much guarantee that Solr is **NOT** consuming 8GB of memory.  It is consuming the 2GB you told it that it could have, plus a little bit extra.  If you don't have any other sizable programs running on this system, then the rest of your memory is being used by the OS -- and if you were to start another program that wanted a large chunk of memory, the OS would instantly and willingly give up some or all of its disk cache and allow that program to have the memory.

Thanks,
Shawn

Reply via email to