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.
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.
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?