Author Topic: OutOfMemoryError  (Read 6060 times)

Offline san14

  • int
  • **
  • Posts: 60
    • View Profile
OutOfMemoryError
« on: July 24, 2007, 03:22:47 pm »
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

Offline Mizuki Takase

  • int
  • **
  • Posts: 97
    • View Profile
Re: OutOfMemoryError
« Reply #1 on: July 24, 2007, 03:50:52 pm »
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.

Offline san14

  • int
  • **
  • Posts: 60
    • View Profile
Re: OutOfMemoryError
« Reply #2 on: July 24, 2007, 04:09:30 pm »
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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: OutOfMemoryError
« Reply #3 on: July 24, 2007, 04:28:13 pm »
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.

Offline Melssj5

  • double
  • *****
  • Posts: 724
    • View Profile
Re: OutOfMemoryError
« Reply #4 on: July 24, 2007, 05:29:04 pm »
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

Offline Mizuki Takase

  • int
  • **
  • Posts: 97
    • View Profile
Re: OutOfMemoryError
« Reply #5 on: July 24, 2007, 09:08:38 pm »
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~

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: OutOfMemoryError
« Reply #6 on: July 24, 2007, 09:23:03 pm »
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

Offline san14

  • int
  • **
  • Posts: 60
    • View Profile
Re: OutOfMemoryError
« Reply #7 on: July 25, 2007, 07:38:29 am »
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
« Last Edit: July 25, 2007, 07:50:28 am by san14 »
San14