• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Heap size and PermSize limitations

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello.

I'm not sure if this has been answered before, but I have searched for a couple of hours now and can't find the answer anywhere on the WorldWideWeb.

I'm having some strange behaviour trying to max out the memory used by, first of all Eclipse, but this goes for all java applications on my machine.

First some numbers:
Windows XP SP 3 32-bit
Intel Core2
3,25 GB RAM (Actually 4GB but since this is a 32bit OS...)
Sun JRE 1.6.0_22

Problem:
I'm trying to run Eclipse with 1024m Max heap size and MaxPermGen 512m, but for some reason I don't understand this is not possible.
There seems to be a magical limit at 1460 Mb of total memory allocated by java.

Some examples:
java.exe -Xmx1000m -XX:MaxPermSize=460m com.xxxxxx.export.Exporter
Error: Needs a view name as first parameter

java.exe -Xmx1000m -XX:MaxPermSize=461m com.xxxxxx.export.Exporter
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

java.exe -Xmx1001m -XX:MaxPermSize=460m com.xxxxxx.export.Exporter
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

java.exe -Xmx1001m -XX:MaxPermSize=461m com.xxxxxx.export.Exporter
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.


Can somebody tell my why I get this behaviour and where I can read about it?

cheers
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


There seems to be a magical limit at 1460 Mb of total memory allocated by java.


Not a Java limit, this is 32bit Windows behaviour. You can allococate a maximum of 2GB for a process, but Windows reserves some of that for its own purposes, plus the JVM needs memory above and beyond the heap for its own purposes, so the real limit is somewhere nearer 1.5Gb. There are various flags you can try to up this to the theoretical limit 3GB virtual, but these not really worth trying (very small increases for a lot of work).

If your application needs more memory then this, run it on linux or a 64bit JVM.
 
Pierre Rehnberg
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Geeez

Paul, thanks for the quick answer.
Ok, a 64-bit OS is what I'll aim for then.

Thanks

 
Marshal
Posts: 74054
332
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And welcome to the Ranch
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how to set java application heap size to 8GB in Ubuntu 64. also RAM 12 GB. is it possible to set ? if yes please tell the parameter?
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic