Connecting Tech Pros Worldwide Forums | Help | Site Map

Out Of Memory Exception

Newbie
 
Join Date: Feb 2007
Posts: 1
#1: Feb 9 '07
HELLO

I have developed some modules in java,executing them causes out of memory exception.
When i m trying to increase heap size in jdk 1.4 or jdk 1.5 i m getting following error.

Invalid flag:-Xmx

I tried setting both -Xmx & -Xms but same error.
pls let me know that following command line is correct.

javac -Xms256m -Xmx256m file.java
??????
Thx

Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#2: Feb 9 '07

re: Out Of Memory Exception


Quote:

Originally Posted by tejal

HELLO

I have developed some modules in java,executing them causes out of memory exception.
When i m trying to increase heap size in jdk 1.4 or jdk 1.5 i m getting following error.

Invalid flag:-Xmx

I tried setting both -Xmx & -Xms but same error.
pls let me know that following command line is correct.

javac -Xms256m -Xmx256m file.java
??????
Thx

You set the heap size to the jvm when running not when compiling. Set the size fo the java command not javac command
Familiar Sight
 
Join Date: Jan 2007
Posts: 168
#3: Feb 17 '07

re: Out Of Memory Exception


Quote:

Originally Posted by r035198x

You set the heap size to the jvm when running not when compiling. Set the size fo the java command not javac command

You can visit :
you can increase the JVM heap size, see discussion

java -Xms<some_min_size> -Xmx<some_max_size>

-Xms<size> set initial Java heap size
-Xmx<size> set maximum Java heap size
-Xss<size> set java thread stack size

you need to set an initial heap size to the value that you want to support apart from the initial heap size.

Regards

but the problem may still occure

could you use a double buffer? be filling one buffer which another thread is writing the other buffer - you can then test to see if first buffer is full before the second is writen - if so you can think about solving that problem, e.g. may need faster machine, faster disk, bigger disk cache?

Visit:
http://www.thescripts.com/forum/thread585847.html
Reply