This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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

Win a copy of Building Microservices this week in the Design forum!
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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: How to get out of 'OutOfMemoryError' ???
It's not a secret anymore!