Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JVM memory allocation

 
satyendra adhikari
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to specify max memory for a JVM more that the available system memory.

Say, I have a machine with 1 GB RAM and I want to run a JVM with max memory setting set to 2GB .
Will it work for an application that needs 2GB memory, any explanation or more information will be much appreciated.

Thank you!!
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your system supports virtual memory, then theoretically you could do that. You might find your application runs slowly or erratically because of the paging involved, though.
 
satyendra adhikari
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, thanks!

so what happens is OS dependent, if the OS can not allow it additional memory (by working around virtual memory in such cases), will it throw out of memory error?
 
Chandramouli Jambunathan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Increase JVM heap size to avoid Out of memory problem..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic