<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Release SOLR JVM memory after index delete in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Release-SOLR-JVM-memory-after-index-delete/m-p/35374#M12762</link>
    <description>&lt;P&gt;Hi Matheiu -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You were right, it was related to Garbage Collection. The moment I loaded another big index, the JVM memory went above 70% and GC was initiated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was just being pre-maturely concerned about this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks Again!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gaurang&lt;/P&gt;</description>
    <pubDate>Thu, 17 Dec 2015 17:15:00 GMT</pubDate>
    <dc:creator>gaurang</dc:creator>
    <dc:date>2015-12-17T17:15:00Z</dc:date>
    <item>
      <title>Release SOLR JVM memory after index delete</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Release-SOLR-JVM-memory-after-index-delete/m-p/35336#M12759</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My use case is zero-down time while batch indexing. To achieve this, I plan to create a new index everyday in batch using MR indexer tool, while the live index serves the queries. After the new index is built I will use collection alias to switch. After the switch I will delete the stale index.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now the concern I have is - After I delete an index (huge index. Around 320 mill documents. Distributed in 64 shards spread over 4 solr instances) the solr JVM memory is not released. While the index is live, the solr jvm shows around 10g occupied. It remains the same even after I delete the index. If the solr service is restarted, the memory is released. My understanding is that solr uses its heap to store different caches for query speedup. But I need to figure out a way to clear this&amp;nbsp;cache (for a particular index) when I delete the index, or else I will soon face OOM errors. Please can someone help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4 solr instances&lt;/P&gt;&lt;P&gt;Solr Java&amp;nbsp;heap size - 20 gb&lt;/P&gt;&lt;P&gt;Direct Memory Allocation - &amp;nbsp;4gb&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below are the HDFSDirectoryFactory settings in solrconfig.xml&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:org.apache.solr.core.HdfsDirectoryFactory}"&amp;gt;&lt;BR /&gt;&amp;lt;str name="solr.hdfs.home"&amp;gt;${solr.hdfs.home:}&amp;lt;/str&amp;gt;&lt;BR /&gt;&amp;lt;str name="solr.hdfs.confdir"&amp;gt;${solr.hdfs.confdir:}&amp;lt;/str&amp;gt;&lt;BR /&gt;&amp;lt;str name="solr.hdfs.security.kerberos.enabled"&amp;gt;${solr.hdfs.security.kerberos.enabled:false}&amp;lt;/str&amp;gt;&lt;BR /&gt;&amp;lt;str name="solr.hdfs.security.kerberos.keytabfile"&amp;gt;${solr.hdfs.security.kerberos.keytabfile:}&amp;lt;/str&amp;gt;&lt;BR /&gt;&amp;lt;str name="solr.hdfs.security.kerberos.principal"&amp;gt;${solr.hdfs.security.kerberos.principal:}&amp;lt;/str&amp;gt;&lt;BR /&gt;&amp;lt;bool name="solr.hdfs.blockcache.enabled"&amp;gt;${solr.hdfs.blockcache.enabled:true}&amp;lt;/bool&amp;gt;&lt;BR /&gt;&amp;lt;str name="solr.hdfs.blockcache.global"&amp;gt;${solr.hdfs.blockcache.global:true}&amp;lt;/str&amp;gt;&lt;BR /&gt;&amp;lt;int name="solr.hdfs.blockcache.slab.count"&amp;gt;${solr.hdfs.blockcache.slab.count:1}&amp;lt;/int&amp;gt;&lt;BR /&gt;&amp;lt;bool name="solr.hdfs.blockcache.direct.memory.allocation"&amp;gt;${solr.hdfs.blockcache.direct.memory.allocation:true}&amp;lt;/bool&amp;gt;&lt;BR /&gt;&amp;lt;int name="solr.hdfs.blockcache.blocksperbank"&amp;gt;${solr.hdfs.blockcache.blocksperbank:16384}&amp;lt;/int&amp;gt;&lt;BR /&gt;&amp;lt;bool name="solr.hdfs.blockcache.read.enabled"&amp;gt;${solr.hdfs.blockcache.read.enabled:true}&amp;lt;/bool&amp;gt;&lt;BR /&gt;&amp;lt;bool name="solr.hdfs.blockcache.write.enabled"&amp;gt;${solr.hdfs.blockcache.write.enabled:false}&amp;lt;/bool&amp;gt;&lt;BR /&gt;&amp;lt;int name="solr.hdfs.blockcache.bufferstore.buffercount"&amp;gt;${solr.hdfs.blockcache.bufferstore.buffercount:0}&amp;lt;/int&amp;gt;&lt;BR /&gt;&amp;lt;bool name="solr.hdfs.nrtcachingdirectory.enable"&amp;gt;${solr.hdfs.nrtcachingdirectory.enable:true}&amp;lt;/bool&amp;gt;&lt;BR /&gt;&amp;lt;int name="solr.hdfs.nrtcachingdirectory.maxmergesizemb"&amp;gt;${solr.hdfs.nrtcachingdirectory.maxmergesizemb:16}&amp;lt;/int&amp;gt;&lt;BR /&gt;&amp;lt;int name="solr.hdfs.nrtcachingdirectory.maxcachedmb"&amp;gt;${solr.hdfs.nrtcachingdirectory.maxcachedmb:192}&amp;lt;/int&amp;gt;&lt;BR /&gt;&amp;lt;/directoryFactory&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gaurang&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 09:53:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Release-SOLR-JVM-memory-after-index-delete/m-p/35336#M12759</guid>
      <dc:creator>gaurang</dc:creator>
      <dc:date>2022-09-16T09:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: Release SOLR JVM memory after index delete</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Release-SOLR-JVM-memory-after-index-delete/m-p/35369#M12760</link>
      <description>&lt;P&gt;First of all we are using the exact same pattern (create a new index, indexing in it and then switch the alias).&lt;/P&gt;&lt;P&gt;But I think your query is not really related to this but more on how Solr behave (with its JVM).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Like this I'm not sure there is a particular problem. I have seen this behavior with a lot of other product. The JVM tend to not release the memory (until the garbage collector reclame it - because there is a need to re-use the memory).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you don't have an answer here, you will want to try to fine tune the GC parameters (This is a real science). But I guess the support might help you also.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best luck !&lt;/P&gt;&lt;P&gt;mathieu&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2015 15:43:01 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Release-SOLR-JVM-memory-after-index-delete/m-p/35369#M12760</guid>
      <dc:creator>mathieu.d</dc:creator>
      <dc:date>2015-12-17T15:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: Release SOLR JVM memory after index delete</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Release-SOLR-JVM-memory-after-index-delete/m-p/35370#M12761</link>
      <description>Thanks Mathieu!</description>
      <pubDate>Thu, 17 Dec 2015 15:46:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Release-SOLR-JVM-memory-after-index-delete/m-p/35370#M12761</guid>
      <dc:creator>gaurang</dc:creator>
      <dc:date>2015-12-17T15:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: Release SOLR JVM memory after index delete</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Release-SOLR-JVM-memory-after-index-delete/m-p/35374#M12762</link>
      <description>&lt;P&gt;Hi Matheiu -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You were right, it was related to Garbage Collection. The moment I loaded another big index, the JVM memory went above 70% and GC was initiated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was just being pre-maturely concerned about this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks Again!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gaurang&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2015 17:15:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Release-SOLR-JVM-memory-after-index-delete/m-p/35374#M12762</guid>
      <dc:creator>gaurang</dc:creator>
      <dc:date>2015-12-17T17:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: Release SOLR JVM memory after index delete</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Release-SOLR-JVM-memory-after-index-delete/m-p/35394#M12763</link>
      <description>&lt;P&gt;That's great to know.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;best regards.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2015 10:29:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Release-SOLR-JVM-memory-after-index-delete/m-p/35394#M12763</guid>
      <dc:creator>mathieu.d</dc:creator>
      <dc:date>2015-12-18T10:29:26Z</dc:date>
    </item>
  </channel>
</rss>

