This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization 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
Pie
Posts: 20770
30
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