Search code examples
javamemory-managementsolrjvmsolrj

Memory not beeing freed while indixing using solrj


We start indexing data from DB using solrj , we retrieve about 1 million record from the DB and then we make some process using java over the record . But we face some problem with the memory . When we start the indexing process the memory start growing to reach 7 G .the problem is that the indexing process finish but the memory dose not decrease its keep allocation for the 7 G.


Solution

  • As you say that the JVM holds the memory, I think you have the problem that is elaborated in JVM sending back memory to OS

    To tackle this you will need to do as Michael Borgwardt wrote there:

    If you want the JVM to return memory to the OS more eagerly, you can use the tuning parameters of the Oracle JVM, specifically -XX:MaxHeapFreeRatio and -XX:MinHeapFreeRatio