OutOfMemoryError

I am facing OutOfMemoryError while compiling the code. It seems that after some amount of memory utilization the compiler is not able to process other funtions. I have tried to increase the heap size from JVM options but it did not work. I am badly stuck on this issue. Please help me out
[300 byte] By [devesh_onlinea] at [2007-10-2 23:16:21]
# 1

Runtime compilation uses memory other than that used for the Java object heap. So increasing the heap size (e.g., with -Xmx) won't help the compilation issue, and might even make it worse, if you make the heap so large that the compiler can't get the memory it needs because you've tied it all up in the Java object heap.

What platform (operating system and hardware) are you running? What version of the JRE are you running? What command line parameters are you specifying, and what error message do you get?

Peter.Kessler@Sun.COMa at 2007-7-14 15:52:47 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2

platform (operating system and hardware) ?Windows-xp /AMD Athlon 64 processor 3000+

What version of the JRE are you running?Trying on both 1.4.2 and 1.3

What command line parameters are you specifying?- server -Xms256m -Xmx256m

and what error message do you get? java.lang.OutOfMemoryError

devesh_onlinea at 2007-7-14 15:52:47 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 3

If you are compiling a lot of source files with javac, you may well need more than 256MB of memory for the Java object heap. For example, when we build the JDK itself (that's a lot of Java source files), we specify -Xmx512m. You can leave the -Xms256m, as that's the initial size of the heap, so we can grow it if we need to, but won't waste the space if we don't need it.

Peter.Kessler@Sun.COMa at 2007-7-14 15:52:47 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 4
After specifying the command line parameters do we need to restart any service?
devesh_onlinea at 2007-7-14 15:52:47 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 5

If this is an invocation of javac (which is what I thought it was), then just putting the -Xmx512m argument on the javac command line should do it. There shouldn't be any "service" involved to restart.

Maybe I'm confused about where you are getting this "OutOfMemoryError while compiling the code". Can you describe what you are doing when you get this error, and maybe even paste the error message to this forum thread?

Peter.Kessler@Sun.COMa at 2007-7-14 15:52:47 > top of Java-index,Java HotSpot Virtual Machine,Specifications...