File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java Micro Edition and the fly likes How to get out of 'OutOfMemoryError' ??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "How to get out of Watch "How to get out of New topic

How to get out of 'OutOfMemoryError' ???

Vaibhav Sanas

Joined: Feb 18, 2003
Posts: 8
Hi !
I get [b]'java/lang/OutOfMemoryError'[\b] in my midlet when I try to run it from Motorola's i88s device. Size of my jar file is 52.6 KB. I get following warning when the application is installed using Motorola iDEN SDK/Emulator:
[i]Install Succeeded!
Occupied Flash Memory: 172508 bytes
Occupied Data Space: 1833 bytes
Warning: The size of this jar file is 53881 bytes (52.6KB). It is larger than the soft limit of device i88s, which is 51200 bytes (50KB)!
I think if my application would have been of smaller size, under 50KB, it would have worked. But the application is already optimized with obfuscation tool and I can not really reduce it any further.
Is there any way to solve this problem?
Thanks in advance.
Liam Quinn
Ranch Hand

Joined: Jan 18, 2002
Posts: 35
Rather than focusing on the JAR size, I would focus on reducing the heap memory required by your program when running. Don't create so many objects.
The J2ME Wireless Toolkit's memory profiler can be helpful for tracking down the main memory hogs. In KToolbar, go to Edit -> Preferences -> Monitoring, and check "Enable Memory Monitor". (This is in version 1.0.4.)
I agree. Here's the link:
subject: How to get out of 'OutOfMemoryError' ???
jQuery in Action, 3rd edition