-1

recently I'm developing a J2ME application using LWUIT library, my application size is 679 KB after obfusticating. in some mobile devices and in non-specific events I get OutOfMemoryError error.

I want to know what this error is for and does it related to Memory of device or its a bug of my application, and what is the solution?

thanks a lot in advance

Roham Rafii
  • 2,929
  • 7
  • 35
  • 49
aida
  • 153
  • 1
  • 9
  • It means (duh!!) you're out of memory. Generally this means out of heap memory (which is limited by a JVM parameter), but on rare occasions you can run out of other pools. Most likely the application created more objects than will fit in allotted memory. – Hot Licks Jan 15 '12 at 20:03
  • tanx Hot Licks for this anwer , actually my application works for both touch screen and non touch screen devices in 2 languages , therefor i had to use lots of icons and images in themes and resources, I have to reduce size of these objects if i dnt find any other way to get rid of this error :( – aida Jan 15 '12 at 20:18
  • First thing to do is to check the docs for your environment and figure out how to adjust the heap size. Unfortunately, the way to do this is somewhat non-standard, but it's generally done with the `-Xmx` parameter on the `java` command. – Hot Licks Jan 15 '12 at 20:43
  • Duplicated http://stackoverflow.com/questions/1390087/javame-lwuit-images-eat-up-all-the-memory – Mun0n Jan 15 '12 at 22:29
  • are you using photos or audio/video file in your project ? – Lucifer Jan 16 '12 at 03:48

1 Answers1

0

Unfortunately there is not a way to tell how to fix your application without studying it. This wiki entry is a good start to understand what to look for when optimizing memory for JavaME apps.

Gorkem Ercan
  • 3,220
  • 1
  • 18
  • 26