MMapDirectory tries to make full use of OS memory (OS Cache), as far as possible, this is normal behavior, it will try to load the entire index into memory, if available. This is actually good. Since this memory is available, it will try to use it. If another application on the same computer requires more, the OS will release it for him. This is one of the reasons Solr / Lucene requests are fast-paced, since most server calls end with memory (depending on the size of the memory), and not with the disk.
JVM memory is another matter, it can be controlled, only working request response objects and some cache entries use JVM memory. Thus, the size of the JVM can be customized based on number requests and cache entries.
Ganesh
source share