A java virtual machine is a C or C++ program. It runs on the OS like any other program. It takes memory to do the things it does. Like any other program.
Joined: Jan 29, 2003
The following is from experience, but may not be true for all JVMs ...
The process size - what the OS reports for java.exe - can start out much lower than the sum of all Java memory maximums. The JVM asks the OS for some fraction of the space it will eventually need. As you create lots of objects, the JVM may ask the OS for more, and you'll see process memory go up. After garbage collection you might expect to see the process memory go back down, but the JVM doesn't give memory back. It just hangs on to it for the next time you need it.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi