Why doesn't Intellij release memory after closing a project?

I had three projects. One of them - Spark - was very large. When closing the spark there is NO difference in memory usage - as reported by the os / x activity monitor. Note: all projects open in the same Intellij instance.

enter image description here

In fact, it uses a little over 4 GB. And I have just opened two projects. These two projects take up only 1.5 GB if I turn off Intellij and run it again.

So what to do to β€œencourage” Intellij to free the memory it uses? It works very slowly (cannot keep up with my typing)

Update I just closed the larger of the two remaining projects. STILL no reduction in memory usage. The remaining project is a single python file . So Intellij should use up to 512Meg at this moment!

+4
source share
3 answers

In response to @PeterGromov's answer, it seems like it was hard to get the memory back. In addition, @KevinKrumwiede mentioned XX:MaxHeapFreeRatiowhich seems like a prospectus.

Here are a couple of these ideas made a little further from Does GC bring memory back to the OS?

The JVM HotSpot frees memory back to the OS, but does so reluctantly.

, -XX: GCTimeRatio = 19 -XX: MinHeapFreeRatio = 20 -XX: MaxHeapFreeRatio = 30, , GC.

Java 9 -XX: -ShrinkHeapInSteps , . OpenJDK.

, . , G1 jdk8u20.

, , JVM GC.

Java?

Yiannis Xanthopoulos Hot Licks (, !), VM :

-XX: + UseG1GC -XX: MinHeapFreeRatio = 15 -XX: MaxHeapFreeRatio = 30 jdk 7 VM, 30% GC, VM . , , .

, , , java , (, UseG1GC ).

-XX:MaxHeapFreeRatio IJ , .

Java7, - , jdk8.

+3

Java . IDE , .

+1

Source: https://habr.com/ru/post/1657171/


All Articles