java.lang.OutOfMemoryError

I'm trying to compile some code on Solaris running jdk1.3.1.

The code compiles fine in Linux in jdk1.3.1. But in Solaris when I use javac I get the error: java.lang.OutOfMemoryError.

But, if I switch to jdk1.2.2... it all compiles fine. What could be the problem with jdk1.3.1?

Any help would be greatly appreciated.

[349 byte] By [rhadley2] at [2007-9-26 5:02:15]
# 1
From the Sun doc on 1.3.1, you need to use the -J switch to instruct javac (a native wrapper around a java program) to use more memory:javac -J-Xmx64m ...See
cmccorvey at 2007-6-29 18:59:25 > top of Java-index,Archived Forums,Java Programming...
# 2
Hi ,As the previous post rightly put u can increase the JVM heap.But it might also help to know what is casuing it.Every time i was having a outofmemeory,it was because of program faults such as creating a lot of objects in an infinite loop etc.
kk77 at 2007-6-29 18:59:26 > top of Java-index,Archived Forums,Java Programming...
# 3

> Hi ,

> As the previous post rightly put u can increase the

> JVM heap.But it might also help to know what is

> casuing it.Every time i was having a outofmemeory,it

> was because of program faults such as creating a lot

> of objects in an infinite loop etc.

>

That is a likely case most of the time. However, the OP was compiling the code, not running it.

Chuck

cmccorvey at 2007-6-29 18:59:26 > top of Java-index,Archived Forums,Java Programming...
# 4

> From the Sun doc on 1.3.1, you need to use the -J

> switch to instruct javac (a native wrapper around a

> java program) to use more memory:

>

> javac -J-Xmx64m ...

>

> See

I was using ANT to do all my compiling. I couldn't figure out a way to pass this in to javac through it, so I just tried using javac by hand and everything worked fine. Even without the -J switch.

So I'm guessing that ANT was sucking up just enough memory to cause javac to run out?

*shrugs* it's compiled now and I'm happy. Thanks for the help.

rhadley2 at 2007-6-29 18:59:26 > top of Java-index,Archived Forums,Java Programming...