Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » -Xmx
-Xmx [message #521969] Fri, 19 March 2010 13:51 Go to next message
No real name is currently offline No real nameFriend
Messages: 1
Registered: March 2010
Junior Member
I'm working on some shortest path algorithms, and I was implementing Floyd-Warshalls algorithm. My system used 1024MB of RAM, which wasn't enough to initialise the large 2D matrix, so eclipse ran out of heap size.

I upgraded my core 2 duo imac from 2x512MB RAM to 1GB RAM + 2GB RAM. The system recognizes the new 3GB RAM on Mac OSX and on my bootcamp booted windows partition.

I use eclipse and had the VM arguments on -Xmx1024M and tried switching it to -Xmx2G. This gives this error:

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

I tried gradually decreasing the amount of used memory, every time getting the same error. The highest amount of RAM I could use is -Xmx1600M. Which still isn't enough to run the program without running out of heap size.

Why can't I use the full amount of memory? (well not the full 3GB ofcourse, but at least I would like to be able to use 2GB to 2,5GB)
Re: -Xmx [message #521979 is a reply to message #521969] Fri, 19 March 2010 14:23 Go to previous message
Vinicius Isola is currently offline Vinicius IsolaFriend
Messages: 40
Registered: March 2010
Location: Brazil
Member
There're many restrictions to memory allocation. The operating system use part of it. Eclipse also will use another part. Other applications running, will also take more memory.

I found this two pages about memory allocation, I don't know if they'll be useful to you but here they are:
http://javahowto.blogspot.com/2006/06/6-common-errors-in-set ting-java-heap.html

http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index. jsp?topic=/rzatz/51/admin/prftunejmem.htm

Try checking how much free memory you have. Normally a windows machine running eclipse will take almost 1GB or more, depending on how much applications you have installed.

Also, from what I understand, when you run an application from within Eclipse, it starts a new process, new JVM. You didn't specify if you placed the argument when starting your app or Eclipse, but the right thing to do is to put the arguments in the Run directive you're using.

I hope it helps.
Regards.
Previous Topic:Building jars headless
Next Topic:How to limit the depth of .project file searching when importing projects
Goto Forum:
  


Current Time: Fri Apr 19 20:41:51 GMT 2024

Powered by FUDForum. Page generated in 0.03101 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top