Is there a way to free memory during big data processing?

I have a database where invoices are stored. I have to perform complex operations during any month with a series of algorithms, using information from all invoices. Obtaining and processing the necessary data for these operations takes up a large amount of memory, since there can be many textures. The problem gets worse when the interval requested by the user for these calculations increases to several years. As a result, I get a PermGen exception because it seems that the garbage collector is not doing its job between calculations for each month.

I always used System.GC to hint that GC is not a good practice to do its job. So my question is: are there any other ways to free memory from this? Can you force the JVM to use HD switching to temporarily store partial computations?

In addition, I tried to use System.gc at the end of each month of calculation, and the result was high CPU usage (due to the garbage collector invocation) and reasonably lower memory usage. That could do the job, but I don't think that would be the right decision.

+5
source share
2 answers

Never use System.gc(). It always takes a lot of time and often does nothing.

, . , , :

  • , . , , -, .
  • , , , , , .
+2

, System.gc() . . JVM . , , . :

  • Null . , ( , gc).
  • .
+1

All Articles