• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

java.lang.OutOfMemoryError

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have this error only in PALM OS device emulator
Can somebody help me how to solve this problem?
Ferdinand
 
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you,
I solved it. I changed
String to
StringBuffer and everything it's OK
Greetings
Ferdinand
 
a sanjuan
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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");
 
It looks like it's time for me to write you a reality check! Or maybe a tiny ad!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic