File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java Micro Edition and the fly likes MIDP heap problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Reply Bookmark "MIDP heap problem" Watch "MIDP heap problem" New topic
Author

MIDP heap problem

Ankur Shah
Greenhorn

Joined: Nov 09, 2001
Posts: 10
In the middle of my MIDlet program I'm getting an "heap out of memory message" do you know what I could do to alleviate this situation.
Ankur
Eric Giguere
Ranch Hand

Joined: Oct 25, 2000
Posts: 170
Your app is using too much memory. You need to either (1) create less or smaller objects, or (2) free more objects. Most of the standard Java techniques for reducing the memory footprint of an application apply: instantiate objects lazily, help the garbage collector (null out unused references early and often), etc. Shameless plug: I discuss these kinds of things in both my J2ME books. But really, any good book on Java application optimization will also cover the material.

------------------
Eric Giguere
author/co-author of:
Mobile Information Device Profile for Java 2 Micro Edition: Professional Developer's Guide
Java 2 Micro Edition: Professional Developer's Guide
PalmTM Database Programming: The Complete Developer's Guide


Eric Giguere
Author/Co-Author of: Mobile Information Device Profile for Java 2 Micro Edition: Professional Developer's Guide, Java 2 Micro Edition: Professional Developer's Guide and PalmTM Database Programming: The Complete Developer's Guide
liang gu
Ranch Hand

Joined: Nov 05, 2001
Posts: 89
I have an interesting and similar problem. The same application runs fine on the Palm VIIx device and never craches. But on Handspring Visor Edge(which is a newer device and has much more memory than Palm VIIx), the application craches quite often. This leads me think that there are bugs either on the device or on the KVM. Can anybody give me some suggestion how to solve the application crashing problem on Handspring Visor/Edge device? Thanks.
Liang
 
 
subject: MIDP heap problem
 
Threads others viewed
WA #1.....word association
static block
Where do static variables (class variables) live (scope)?
Heap
what is the default size of java heap
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com