[Solved] Java heap space error
I'm working on a runescape private server and I recently coded it to preload the world map in order to keep NPCs from "no-clipping" through objects. After I set up the code and went to run the server, I get this error message:
Code :
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at config.WorldMap.loadWorldMap(WorldMap.java:60)
at org.skillmenation.server.Server.main(Server.java:58)
I found a link and this is what it says:
Code :
How to set java heap size in Eclipse?
You have 2 options:
1. Edit eclipse-home/eclipse.ini to be something like the following and restart Eclipse.
-vmargs
-Xms64m
-Xmx256m
I changed my eclipse.ini to:
Code :
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms64m
-Xmx512m
But I'm still getting the same error. Do I need to up the Xmx some more?
Solved:
Quote:
Originally Posted by
copeg
In my version of Eclipse there is a Program Arguments and VM arguments box. If you have these two add it to the VM arguments
Re: Java heap space error
While I'm unfamiliar with 'runescape', it seems to me you are setting the heap size for an IDE (Eclipse) and not the program you are running. You should set the heap size using Xmx via a command line when you run the program you want to run (in Eclipse, go to Run -> Run Configurations -> Arguments )
Re: Java heap space error
So I should add:
Code :
java -Xms<initial heap size> -Xmx<maximum heap size>
in Program Arguments?
EDIT:
"Extra Notes: You need to be running windows xp or higher to really try this is loads 213mb worldmap files which in theory means you need to ahve 256mb ram at least to run this without any connections so you probalyl need 512mb ram"
-http://www.rune-server.org/showthread.php?t=70232
Re: Java heap space error
In my version of Eclipse there is a Program Arguments and VM arguments box. If you have these two add it to the VM arguments