OutOfMemoryError

Started by san14, July 24, 2007, 03:22:47 PM

Previous topic - Next topic

san14

HI
   I have added some object to existing, working project. and now I am getting memory out of  error as

     
Quote
               Processing object from 3DS-file: Line39
               Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
     

How do I over come this. Can some one help me for the same


With Regards
San14
San14

Mizuki Takase

I am not sure, but maybe you should try to start your applications like: java -Xms256m -Xmx512m gamePackage.GameTest   You can change the values to something really high if you need more memory.

san14

Hi Mizuki Takase

   Thanks for your reply. But I am facing this problem while compiling and after this error message It comes out of compilation.

With Regards
San14
San14

EgonOlsen

But it's not compiling, it's running. Or how comes this line: "Processing object from 3DS-file?"...for sure not from the compiler. However, if you are having a memory problem with Eclipse itself (i assume that you're using Eclipse?), you can increase memory in the eclipse.ini.

Melssj5

The compilation is in few words a checking of grammar and semantic, nothing else. The compilation cannot give errors like that.

The output
"Processing object from 3DS-file: Line39" is clearly a message when RUNNING jpct. So you must be c ompiling and runing inmediatly.

That problem comes because java tries to use more memory that the asigned, you can increase it on the way Mitsuki said. or maybe changing the ini file Egod said.
Nada por ahora

Mizuki Takase

I am sure that you have to be getting that problem while you are running the code. You did say that you got the problem after adding one object onto a working project. I am sure that you did that properly since you did not receive any other error messages like "cannot resolve variable", "invalid expression" or whatever compile-time error message.

The problem that you said is a run-time error message. OutOfMemoryException occurs when you use up more than the initial 64mb(maybe less than that?) of ram that is normally allocated for the Java Virtual Machine. That was why I said to run your program using more memory. An alternative solution would be to not load some sort of 1280 x 1280 texture or a 6 giga-million verticed 3D object.

Most likely, you should try to see if the first solution works first before trying out the alternatives~

EgonOlsen

You can add the -Xmx256m in the same way you did with the -Djava.library.path here: http://www.jpct.net/forum2/index.php/topic,740

san14

#7
Hi

    Thanks for suggestion I will work it out today. And I am sorry it is not during compile time. As EgonOlsen  said I am using Eclipse  So it compiles and runs at same click of run button. So could not make out the difference.

With Regards

San14
San14