This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Java in General and the fly likes Heap size and SoftReference Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Heap size and SoftReference" Watch "Heap size and SoftReference" New topic
Author

Heap size and SoftReference

Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
If command-line options (-Xmx, -Xms, -XX:MinHeapFreeRation, -XX:MaxHeapFreeRatio) allow, Java will grow and shrink the heap according to the demands of the running application. I've played with these settings and they all seem to do what I expect.

However, there is a complication about which I have been unable to find any information. This involves SoftReferences, of which I have lots, for various caches.

When deciding whether to grow or shrink the heap, does Java include softly-referenced objects in its calculation of required memory?

In other words, will Java clear all my SoftReferences before deciding it has to grow the heap? Or will it grow the heap to avoid having to do so?


Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.<br /> <br />#:^P
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Heap size and SoftReference
 
Similar Threads
Problem with objects and classes
JVM memory releasing after memory consuming task
Why are objects created on the HEAP compared to the STACK ?
memory problems,
Memory leaks in GUI programs