06-17-2009 11:51 AM - edited 06-17-2009 12:17 PM
We are working on an app, it is only 80K in size and it will call to the server to request for an xml files back and put it in nodelist and then transfer into array. and then it is on screen with the values.
BUT, the app doesn't even able to load and the device keep loading for 5 mins and then it pops up an error message saying: "Uncaught exception: java.lang.OutOfMemoryError
Solved! Go to Solution.
06-17-2009 12:36 PM - edited 06-17-2009 12:37 PM
The compiled size of your app is not the issue. Somewhere in your code you are allocating new objects and keeping references to them. It sounds like there may be either a simple infinite loop or else infinite mutual recursion somewhere (perhaps among constructors, since this seems to happen during start-up). The debugger is the ideal tool for tracking down this sort of thing.
On second thought, mutual recursion is not so likely, since you'd probably get a stack overflow exception long before you ran out of memory.
06-17-2009 12:45 PM
But the program can run successfully in the simulator......
If some area is looping forever, the program should not continue to process in simulator.
I am trying to cut some piece of the program to test if where it is failed in the machine.
Will there be the problem in FileConnection or Image loading?
06-17-2009 03:33 PM
Ah. You didn't mention before that it ran in the simulator. Two main reasons for differences between the simulator and a real device are code signing and application permissions--the simulator requires neither; a real device requires both. So if, for instance, you have fall-back processing in case a file access fails, then the fall-back code will likely never be run in the simulator. Not knowing anything else about your app, I'd suggest looking for that kind of thing.
Also, it may or may not be important, but on what device/software version(s) is it failing, and on what version(s) of the simulator does it work?
06-17-2009 04:59 PM
We are using the Bold devise for the real testing and using JDE4.6 for the simulator.
Everything seems to work in the simulator but so many problem arise in the real machine. Please help and advise.
06-17-2009 06:49 PM
I think that Ted gave you as much advice as you are going to get without more information.
You need to do some more problem determination on the device, like pulling the device event log and looking for exceptions.
You might also make sure you have some strategic "System.out.println()" statements in your code so that you can view output on the console window and determine where you are blowing up.
06-17-2009 07:25 PM
06-18-2009 03:53 AM
Try using this class for on device debbugging net.rim.device.api.system.EventLogger.
06-18-2009 03:59 AM
Run profiler in JDE and debug the application, especially the part that throws the exception.
Check the objects qty and size in profiler and act accordingly.
To get information about working with profiler in JDE open menu Help - IDE Help
06-22-2009 01:23 AM