Runtime.freeMemory() and Runtime.totalMemory() questions

OK, can someone verify my assumptions about these two methods and memory allocation in general. My assumptions are as follows, please tell me if they are correct or not:

totalMemory() should return the total amt of memory the JVM currently 'owns'. Some of this memory will be already allocated to objects, and some of it will be free for the creation of new objects.

freeMemory() should return the amount of memory the JVM 'owns'(totalMemory), that is not currently allocated to any objects.

totalMemory() minus freeMemory() should equal the amt of memory currently allocated to objects by the JVM.

Whenever freeMemory gets to a certain low point(possibly 0?), the JVM will request more memory from the system, thus increasing the totalMemory value.

OK, are all those statements correct?

So, is there any point at which the totalMemory value will reduce? I've seen it grow and grow, but I've never seen it reduce itself. In other words, will the JVM ever release memory back to the system?

Thanks.

[1064 byte] By [ragnor] at [2007-9-26 4:20:12]
# 1

In case anyone is intersted. I've done quite a bit of testing and I believe my original assumptions to be correct. Also, I finally did see a case where the totalMemory was reduced. This occurred when freeMemory grew drastically due to some heavy cleaning up. The JVM decided it had more totalMemory than it needed I guess, and released a good chunk of it back to the system.

ragnor at 2007-6-29 17:23:18 > top of Java-index,Java HotSpot Virtual Machine,Specifications...