Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to set memory used by JVM.

843811Jul 24 2001 — edited Jun 6 2002
Who knows how does the JVM set the physical memory it wanted? Or is there any method to enlarge the JVM memory at runtime?
When I use "Java xxx" to run a small class the Runtime.totalMemory() report a small total memory.
And when I use "java yyy" to run a large class the method will report a large total memory.
This way it seems that the JVM will determine the total memory according to the run time work, but when I run a very large work with a lot of memory used the JVM will report a out of memory exception. But when this happened the actual physical memory of my computer still have millions of byte unused.
Is that a bug of JVM or something else?
Who knows? Please tell me.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 4 2002
Added on Jul 24 2001
3 comments
203 views