Re: How much of your RAM can you use with the -Xmx option?



"Roedy Green"
<my_email_is_posted_on_my_website@xxxxxxxxxxxxxx>
wrote:

> Adam Funk <a24061@xxxxxxxxx> wrote:

>> What proportion of the RAM on a machine can you
>> give to the java -Xmx option?

You give a quantity of memory, but it isn't
specifically virtual or real (RAM) memory, best I
can understand, just "memory".

> You can give any percent you want.

Careful. If you give more than 2^31 bytes, at least
on a 32 bit hardware CPU (that's -Xmx2048m), you'll
get an error message about exceeding the addressing
limit. Most default setups won't let you have even
that much because the swap region isn't that big by
default.

> Since RAM is virtual

Umm, nope, but someone else told you that. "RAM" is
"Random Access Memory", the hardware stuff. It can
be _organized_ as (part of) virtual memory, with some
paging scheme, but it is inherently real memory itself.
[Virtual memory isn't "Random Access Memory", you get
a whole page, or you get nothing at all, you can't
ask for a smaller fraction of a page to be loaded
from the swap space.]

> you can give more than you have. You will
> discover by experiment the optimal amount. It
> depends on what other programs you want to run at
> the same time, your OS and the relative speed of
> your disk/cpu/ram.

Yes, but -- the main factor is how much you want to
sacrifice to cut down the frequency of Java garbage
collection pauses (and yes, I know there are obscure
ways to spread them out, in theory, to be nearly
indetectable), backed up by the even more stringent
requirement of how much you have to give to allow
your application to run at all. My toy Traveller
lets me eat memory at will, just by increasing
either the problem size or the (genetic algorithm)
population size, or both, and it is trivial to
overrun the 64MBytes which is the Java heap space
default. I usually run with -Xmx512m or -Xmx1024m,
depending on the size of the hard drive swap area
I've reserved on the particular computer, which
Works For Me but might drive others nuts.

FWIW

xanthian.








--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
.



Relevant Pages

  • Re: Do I need a Page File?
    ... Intel designes the virtual memory. ... >> unlimited amounts of RAM, we wouldn't even NEED a paging file. ...
    (microsoft.public.windowsxp.general)
  • Re: Steve Jobs demos Macintosh in 1984
    ... Woody wrote: ... Stop annoying the fucking hell out of me, ... For sure not much computer memory had been made in 1948 - but it could ... For sure you got a bit more RAM to use in the Speccy - ...
    (uk.comp.sys.mac)
  • Re: Windows 2000 Server StandardEdition /PAE Question
    ... Physical Memory with Virtual Memory and /PAE with 4GT RAM Tuning. ... Using the /PAE switch does not provide more physical memory to the ...
    (microsoft.public.win2000.general)
  • Re: Usable RAM
    ... How about using Windows XP x64? ... The rest gets taken by such items as shared memory on the graphics ... Photoshop says that the available RAM is 1.711GB. ... you will never get to use the full 4gb virtual memory because ...
    (microsoft.public.windowsxp.general)
  • Re: How to determine memory usage?
    ... So you really only have 458 MB of RAM ... Check the Virtual Memory Size box click OK. ... Memory column next to your Mem Usage column. ...
    (microsoft.public.windowsxp.general)