32G ram

M

mcheung63

hi all
i got 32GB ram, why i can't -Xmx2G, it got an error "Could not create the Java Virtual Machine"

/root>free -m
total used free shared buffers cached
Mem: 32387 16973 15413 0 243 11906
-/+ buffers/cache: 4823 27563
Swap: 1906 0 1906
/root>uname -a
Linux localhost.localdomain 3.6.9-2.fc17.i686.PAE #1 SMP Tue Dec 4 14:15:28 UTC 2012 i686 i686 i386 GNU/Linux

thanks
from Peter ([email protected])
 
A

Arne Vajhøj

i got 32GB ram, why i can't -Xmx2G, it got an error "Could not create the Java Virtual Machine"

/root>free -m
total used free shared buffers cached
Mem: 32387 16973 15413 0 243 11906
-/+ buffers/cache: 4823 27563
Swap: 1906 0 1906
/root>uname -a
Linux localhost.localdomain 3.6.9-2.fc17.i686.PAE #1 SMP Tue Dec 4 14:15:28 UTC 2012 i686 i686 i386 GNU/Linux

32 bit or 64 bit Java?

Arne
 
A

Arne Vajhøj

17.12.2012 05:09, Arne Vajhøj kirjoitti:

Apparently 32 bit, as the i686 OS is 32 bit PAE too.

Then that explains it.

32 bit Java on x86 usually only allows for around 1.7 GB
of heap space.

Arne
 
L

Lew

Arne said:
Donkey said:
Arne Vajhøj kirjoitti:
mcheung63 wrote:
i [sic] got 32GB ram, why i [sic] can't -Xmx2G, it got an error "Could not
create the Java Virtual Machine"

Because you allocated all the available memory to the heap, and none to theJVM
or class space, stack, ... .

How much RAM you have is irrelevant; it's how much RAM you are allowed to allocate
per process with a 32-bit Java.

Assuming the other posters are correct and you're using a 32-bit system. Are you?

That might have been good to tell us in the beginning.
Then that explains it.

32 bit Java on x86 usually only allows for around 1.7 GB
of heap space.

Bear in mind, OP, that "2 GB" is the maximum allocation for the *entire process*, not
just the heap. If you allocate the whole amount for heap, that leaves nothing for stack
or the interpreter. That's why it fails.

So the 1.7 GB or so is all you can get and still leave room for Java itself..

But why, pray tell, are you using a 32-bit system?
 
N

Nigel Wade

17.12.2012 05:09, Arne Vajhøj kirjoitti:

Apparently 32 bit, as the i686 OS is 32 bit PAE too.

32bit Java on 32bit Linux should allow an application of up to 4GB. How
much can of that can be allocated to the heap depends on the particular
application. I've allocated more than 2G to heap on a 32bit Linux
system, see this old thread on Google Groups:
https://groups.google.com/forum/?hl=en-GB&fromgroups=#!topic/comp.lang.java.programmer/iGr3bxL9ZCA

There may be a per-process limit. Try "ulimit -a" to see what limits the
sysadmin has set.
 
B

BGB

32bit Java on 32bit Linux should allow an application of up to 4GB. How
much can of that can be allocated to the heap depends on the particular
application. I've allocated more than 2G to heap on a 32bit Linux
system, see this old thread on Google Groups:
https://groups.google.com/forum/?hl=en-GB&fromgroups=#!topic/comp.lang.java.programmer/iGr3bxL9ZCA


There may be a per-process limit. Try "ulimit -a" to see what limits the
sysadmin has set.

you only get a 4GB process limit if the kernel is built with a special
option, which gives 4GB per process but at the cost of making switching
to/from kernel-space (such as in a system call) slower.

in a more typical setup, it is 3GB for application, 1GB for kernel.
this sets an effective upper limit of 3GB which the application can use.

32-bit Windows currently has the same limit, although older versions
only allowed around 2GB per application (the other 2GB was: 1GB shared
memory, 1GB kernel).
 
A

Arne Vajhøj

32bit Java on 32bit Linux should allow an application of up to 4GB. How
much can of that can be allocated to the heap depends on the particular
application. I've allocated more than 2G to heap on a 32bit Linux
system, see this old thread on Google Groups:
https://groups.google.com/forum/?hl=en-GB&fromgroups=#!topic/comp.lang.java.programmer/iGr3bxL9ZCA

32 bit Java can in theory use up to 3 GB on 32 bit OS on x86 if the
border between process and system is changed (/3GB). But on Windows
JRocket is supposedly the only Java that can do it.

32 bit Java can never use 4 GB on 32 bit OS on x86, because that
does not leave any address space for the OS.

32 bit Java can use 4 GB on 64 bit OS on x86, because the OS
are running in 64 bit addresses (or something like that), if various
requirements are in place. I don't know what Java versions support
that.

Arne
 
N

Nigel Wade

32 bit Java can in theory use up to 3 GB on 32 bit OS on x86 if the
border between process and system is changed (/3GB). But on Windows
JRocket is supposedly the only Java that can do it.

Sorry, yes, I had confused myself by thinking about PAE. For normal
32bit systems this is true.
32 bit Java can never use 4 GB on 32 bit OS on x86, because that
does not leave any address space for the OS.

However, the OP is using a PAE kernel. That should theoretically allow a
per-process limit of 4GB. I've never had the chance to use PAE kernels
on PAE supported hardware, but IIRC that's what PAE is for, isn't it?
 
B

BGB

Sorry, yes, I had confused myself by thinking about PAE. For normal
32bit systems this is true.

it is also true of systems using PAE.

there is a way to get around the 3GB limit though, but it actually
involves a different strategy:
swapping out the page tables on transitions to/from kernel space.

big downside: this is kind of slow...

However, the OP is using a PAE kernel. That should theoretically allow a
per-process limit of 4GB. I've never had the chance to use PAE kernels
on PAE supported hardware, but IIRC that's what PAE is for, isn't it?

no, PAE does not expand the size of the virtual address space, only the
physical address space (mostly via making page-table entries bigger, and
adding another page-table level):
4kB / 8 = 512 (2^9)
9*3 + 12 = 39
but, the top-level is only partially filled (4 entries), so:
9+9+2 + 12 = 32
vs (non-PAE):
4kB / 4 = 1024 (2^10)
10+10 + 12 = 32


the reason for expanding the page-table entry size is mostly so that
they can refer to more pages (more bits allowing a larger physical
address space).


it means essentially that you can have 36-bits (or more) for the
physical RAM, but still only 4GB per-process (apart from using ugly
bank-switching nastiness).

given that the kernel still needs to map into a 4GB space, there is
little change from before (leaving a full 4GB for the app requiring an
address-space switch).


PAE is partly involved in x86-64 though.

more levels of page-tables may be used:
4kB / 8 = 512 (2^9)
9*4 + 12 = 48
9*5 + 12 = 57

note that the size of the external (physical) address bus is independent
of the size of the supported virtual address space, and depends some on
the processor.

note that, while 64 bit page-table entries would theoretically allow up
to a full 64 bit physical address... AMD shaved off some of the
high-order bits for use for more flags (like the NX bit). hence, there
is currently a limit here of 56 bits.

not like we will likely be seeing this much RAM anywhere in the near
future though...
 
A

Arne Vajhøj

Sorry, yes, I had confused myself by thinking about PAE. For normal
32bit systems this is true.


However, the OP is using a PAE kernel. That should theoretically allow a
per-process limit of 4GB. I've never had the chance to use PAE kernels
on PAE supported hardware, but IIRC that's what PAE is for, isn't it?

No.

PAE allows you to have more than 4 GB RAM.

PAE does not increase virtual address space at all.

A system with PAE can utilize the RAM by having multiple
processes each having 2 or 3 GB virtual address space
mapped into real RAM.

Or by using a special API that allows one to programmatically
change what some virtual addresses is mapped to.

Arne
 
T

Tim Slattery

A system with PAE can utilize the RAM by having multiple
processes each having 2 or 3 GB virtual address space
mapped into real RAM.

Any Windows XP, Vista, Win7, etc 32-bit system can do that, PAE or
not. That's what the virtual memory system is all about. Each process
- and there are dozens running at any time - thinks it has a 4GB space
all to itself. The VM system swaps things in and out to keep everybody
happy. Same thing in 64-bit systems, but the size of the space that a
64-bit process thinks it has is 8 terabytes. The amount of physical
RAM in the system has nothing to do with this.
 
A

Arne Vajhøj

Any Windows XP, Vista, Win7, etc 32-bit system can do that, PAE or
not. That's what the virtual memory system is all about.

Yes.

But non-PAE systems can only access 4 GB of RAM.
Each process
- and there are dozens running at any time - thinks it has a 4GB space
all to itself.

Each process has 4 GB of virtual address space.

Virtual address space gets translated to physical addresses
by the CPU using pagetables.

Without PAE the pages tables contain 32 bit physical addresses.

With PAE the page tables contain 36 bit physical addresses.

Which is why non-PAE systems cam only have 4 GB of RAM and PAE
systems can have 64 GM of RAM.

Note that desktop versions of Windows prevents more than
4 GB of RAM even with PAE.

Arne
 
B

BGB

Yes.

But non-PAE systems can only access 4 GB of RAM.


Each process has 4 GB of virtual address space.

Virtual address space gets translated to physical addresses
by the CPU using pagetables.

Without PAE the pages tables contain 32 bit physical addresses.

With PAE the page tables contain 36 bit physical addresses.

Which is why non-PAE systems cam only have 4 GB of RAM and PAE
systems can have 64 GM of RAM.

Note that desktop versions of Windows prevents more than
4 GB of RAM even with PAE.

but, you can still have a bit more in terms of swap-space though.

say, 16GB in swap-files.

this does require doing a few things manually though, as IIRC, 32-bit
Windows only allowed about 4GB of swap-space per-drive.


granted, yes, things don't really run well.
back in those days, it was a great challenge trying to, say, run
Borderlands and Firefox at the same time. it would require killing off
Firefox for Borderlands to run ok.

this was an advance of 64-bit Windows over 32-bit Windows:
now a person can have a lot more apps running.


before then, multicore was an advance over single-core, as then
background apps wouldn't so much interfere with foreground apps.

before then, XP was an advance over 9x, as it didn't crash as often.
and, Win9x was an advance over 3.x, in that a frozen app would not
(generally) lock up the OS in 9x...

oh, the good old days, when hitting the power switch or reset button was
much less uncommon...
 
A

Arne Vajhøj

but, you can still have a bit more in terms of swap-space though.

say, 16GB in swap-files.
Yes.

this does require doing a few things manually though, as IIRC, 32-bit
Windows only allowed about 4GB of swap-space per-drive.

I think there is a way to put the files just in different directories
by doing some registry magic.

But yes - it is 4 GB per page file.

Arne
 
S

Sven Köhler

Am 17.12.2012 04:05, schrieb (e-mail address removed):
hi all
i got 32GB ram, why i can't -Xmx2G, it got an error "Could not create the Java Virtual Machine"

Well, because you decided not to run a 64Bit OS on your machine.
/root>free -m
total used free shared buffers cached
Mem: 32387 16973 15413 0 243 11906
-/+ buffers/cache: 4823 27563
Swap: 1906 0 1906
/root>uname -a
Linux localhost.localdomain 3.6.9-2.fc17.i686.PAE #1 SMP Tue Dec 4 14:15:28 UTC 2012 i686 i686 i386 GNU/Linux

Please install a 64Bit OS. That will get rid of the overhead that PAE
causes and will allow individual processes (e.g. a virtual machine) to
consume more than just a few gigs of memory.


Regards,
Sven
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top