This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Java Micro Edition and the fly likes java.lang.OutOfMemoryError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "java.lang.OutOfMemoryError" Watch "java.lang.OutOfMemoryError" New topic
Author

java.lang.OutOfMemoryError

alimadhi
Greenhorn

Joined: Jun 12, 2002
Posts: 4
I have this error only in PALM OS device emulator
Can somebody help me how to solve this problem?
Ferdinand
a sanjuan
Ranch Hand

Joined: Jun 12, 2002
Posts: 164
your app is consuming too much memory, i'll say. there are tons of articles on the web on how to optimize J2ME and midlets so as to conserve resources. remember that these are small devices with constrained resources.
NOTE: you can usually change the heap size of the emulator to accomodate apps with more intensive requirements.
alimadhi
Greenhorn

Joined: Jun 12, 2002
Posts: 4
Thank you,
I solved it. I changed
String to
StringBuffer and everything it's OK
Greetings
Ferdinand
a sanjuan
Ranch Hand

Joined: Jun 12, 2002
Posts: 164
yep, that's one of the first things to optimize, immutable objects like strings.
i've also tried to "reuse" stringbuffers:
StringBuffer x=new StringBuffer();
x.append("xxx");
..
..
..
// set length to 0 again and create new string after
x.setLength(0)
x.append("yyy");
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.OutOfMemoryError