
Originally Posted by
jdesmedt
Is it possible that the phones can't handle the amount of data?
That is a very serious possibility. Let me give you an example of my memory problem:
In my midlet I'm drawing a graph, and for that I need a large integer-array: int[width*height]
Nokia JVMs have 2.048 kb of heap space. Sony Ericsson's only have 1.024 kb of heap space. So you would think that Nokias would give fewer OutOfMemoryErrors, right?
I developed my graph and tested it on a SE K800i. I actually allocate int[(2*width)*(2*height)] in order to obtain some simple antialiasing. This works every time in SE JVMs. However when I started testing it on Nokia 3110 Classic, 5200, 5310 XpressMusic and 6500 classic, I got OutOfMemoryErrors on the devices with 240x320 pixel display (5310 and 6500).
So the workaround I had to make was:
Code:
try
allocate double display size
catch OutOfMemoryException
try
allocate display size
catch OutOfMemoryException
write('Not enough memory for graph')
I always get an antialiased graph on Sony Ericssons with high resolution (240x320), but I'm lucky if I get a graph at all on Nokias with 240x320 resolution.