Yes. Don’t set those memory restrictions, just xms and xmx, both to 31 gigs. Java has problems past that line and will make the gc go into a bad loop. I can send you a link as to why https://community.datastax.com/questions/3661/why-is-a-32-gb-heap-allocation-not-recommended.html
But this is almost like a protected secret > On Aug 29, 2021, at 1:52 PM, Shawn Heisey <apa...@elyograg.org> wrote: > > On 8/29/2021 2:38 AM, HariBabu kuruva wrote: >> Is it required to define both the parameters SOLR_HEAP and SOLR_JAVA_MEM. >> or can i comment SOLR_HEAP and only define SOLR_JAVA_MEM. >> Also what highest value of Xmx value i can go if i receive OOM with 31gb. >> I have only solr running on that node. > > If both are defined, I do not know which one will actually take effect. > Figuring that out would require looking at the startup script and doing some > experiments to see what Java actually does. > > I would personally remove SOLR_JAVA_MEM and only go with SOLR_HEAP. Then you > can do something very simple like the following, and the Solr startup script > will set both -Xms and -Xmx java options to that value: > > SOLR_HEAP=4g > >> And could you please let me know the reason to disable swap memory. > > If a system starts actively swapping, its performance in general will be > extremely low. If that happens, it is an indication that there is not enough > physical memory and the system needs more, or that configurations need to be > adjusted to require less memory. > > Disabling swap makes it impossible for the OS to try and use disk space as > memory. In situations where programs are asking for too much memory and you > have swap completely disabled, either Java or the OS will simply kill the > process that's asking for too much memory, rather than letting it run and > destroy overall performance. > > --- > > Responding to something in the OP: > > It is completely normal to see 100 percent memory utilization on just about > any server, whether it's running Solr or not. The OS will use all available > memory for caching purposes, to speed everything up. The only time you won't > see 100 percent memory usage is when you have far more memory than the system > actually needs. For instance, if you had 512GB of memory on a system that > only handles megabytes of data. > > https://cwiki.apache.org/confluence/display/solr/SolrPerformanceProblems > > (disclaimer: I wrote the wiki page linked here. Any errors are mine.) > > Thanks, > Shawn