Optimizing
J2ME applications usually do not run like native C++ applications. The performance is always penalized in terms of speed and memory footprint (RAM). For performance tuning of any J2ME application certain factors can be considered while writing programs(coding) like I/O, threading etc. This article contains tips discussing how to improve performance of a J2ME application by considering many such factors.
Tips
Creating and Discarding Objects
Object creation is very costly with respect to memory and performance overhead. new objects in Java can be created using the new keyword. So create objects only when its needed, don’t create objects in loop like
for (int i = 0; i < length; i++) { ClassName p = new ClassName (); results[i] = p.calculateResult(); }