Java garbage collection problem
问题 So I have this extremely memory-intensive Java application I'm building, which builds a tree of millions of nodes. Using the handy dandy Runtime methods for getting heap information, I built a nice little method that displays the current memory usage, as shown below: public void displayMemoryUsage() { long maxMem = Runtime.getRuntime().maxMemory(); long freeMem = Runtime.getRuntime().freeMemory(); long heapMem = Runtime.getRuntime().totalMemory(); long usedMem = heapMem - freeMem; System.out