can we extended memory as much as we wish ?

G

gk

Hi,

can we extended memory as much as we wish ?

for example, if the machine has PHYSICAL RAM 250 MB

can we do the below ?

java -Xmx1024m YourClass // see we are putting here 1 GB ..right ?

is it feasible ? ( i am thinking whether page memory will add upto heap
memory or not )
 
M

Manish Pandit

No, you cannot. The number has to be smaller than available physical
memory. Here is the error you will get:

Error occurred during initialization of VM
Could not reserve enough space for object heap

-cheers,
Manish
 
M

Manish Pandit

No, you cannot. The number has to be less than the available physical
memory. If you do, here is the error you'd get:

Error occurred during initialization of VM
Could not reserve enough space for object heap

-cheers,
Manish
 
G

gk

Manish said:
No, you cannot. The number has to be smaller than available physical
memory. Here is the error you will get:

Error occurred during initialization of VM
Could not reserve enough space for object heap

-cheers,
Manish

thanks
 
N

Nigel Wade

Manish said:
No, you cannot. The number has to be less than the available physical
memory. If you do, here is the error you'd get:

No, it has to be less than the available *virtual* memory. Java has no access to
physical memory, only the virtual memory as provided by the OS.

On a system with 750MB of physical RAM I can run Java with -Xmx1024 or even
-Xmx1200. When I ask for 1300MB it gets a little slow...
 
C

Chris Uppal

Nigel said:
No, it has to be less than the available *virtual* memory. Java has no
access to physical memory, only the virtual memory as provided by the OS.

It's probably worth adding a specific warning that using more virtual memory
than there is physical memory can be /very/ slow if you end up with "live"
memory paged out. In such cases the system will thrash as the GC attempts to
scan the live memory.

Personally, I would be /very/ reluctant either to use myself, or to put into
production, an application which required more virtual memory than was
physically available[*] and which was written in a GCed language.

-- chris

([*] bearing in mind that the OS and other apps will want their share too)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top