• Post Reply Bookmark Topic Watch Topic
  • New Topic

Assigning/allocating memory issues  RSS feed

 
Edward Kin
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm trying to run a program that requires alot of memory. It's falling over after some time with out of memory issues. As a test I've been using the following to see tha maximum amount of memory that I can assign:

C:\> java -Xmx1050m

At this point it fails as it cannot reserve enough space for the object heap.

I can assign 1042m (obviously it fails as there is nothing to run - it's just a test to see max allocation details).

Anyway this is on a machine with 4 gig of ram physically installed which is the max for a win 32 machine as I understand it. Out of that I actually have about 3.25gig available and from that about 2.95gig after overheads. It's a duel core machine. I was hoping to get more like 1.5gig for the JVM rather than just about 1gig.

How much memory should the JVM heap be able to use ?

Thanks,
Ed
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think there are rules for the -Xmx values, like a multiple of 512 or something but I don't recall off the top of my head... and those rules might not be the same for all JVM versions.
 
Campbell Ritchie
Marshal
Posts: 56536
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will find details of the Java tool here (this page for Windows only).
 
Edward Kin
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK it's less the grammar of the allocation it's more the fact that I can only assign about a GB (1024/1042 whatever - it won't assign say 1524m which is what I am after).

Should I be able to allocate more than about a Gig of ram ?
Should I be able to allocate 1524m of ram to the JVM with my system setup ?

Thanks.
 
Vlado Zajac
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I work on one project which uses -Xmx1500m and works on most setups. Some computers require lower amount.

Maximum for 32-bit Windows programs is 2GB of (virtual) memory for each process (unless /3GB switch is active and the program (JVM) supports it).

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!