WTK Memory capacity

What is the current memory capacity if wtk 2.2? How can we handle out of memory error?
[93 byte] By [anirban_5683a] at [2007-11-27 7:01:33]
# 1

I dont remeber the exact value , but you can change the ammount of memory for the emulator from the WTK-> prefrences -> storage-> heap size

this will emulate a device with the ammount of memory you just specified.

>>how to handel out of memory

1- the keyword"new" is not that simple to use( kep that in mind)

2- srround the most suspected memory consumer code with try and catch , to catch OutOfMemoryError. ( please note this is not Exception , this is error)

3- after catching the erroe run gc(), to clean up some resource.

4- gc() is not that cheap to call , so call it when u just released a heavy *** object and u about to create new heavier *** one.

finally

good code will be out of memory safe. ,btu bad code not only OutOfMemoryError generator , but also a main cause of the phone restart issue

amr

aromra at 2007-7-12 18:52:24 > top of Java-index,Java Mobility Forums,Java ME Technologies...