Question

I am developing an app for S40, focused to work in the Nokia Ahsa 305. In some pages of the app, I show some tables filled with so many data (21 rows with 10 columns, like 210 Label data). When I show that table the memory use, rise a lot and when I try to show again the table, it gives me OutOfMemoryException.

Are there some guidelines that can be carried out for efficient memory management?

Here you can find some images from my memory diagram.

Before showing the table:

Before

When I show the table:

Showing

After going back of the Table form

After

Was it helpful?

Solution

Memory shouldn't rise noticeably on that amount of data. I would doubt a table like this should take more than 200kb of memory unless you use images in some of the labels in which case it will take more. A Component in Codename One shouldn't take more than 1kb since it doesn't have many fields within it, however if you have very long strings in every component (which I doubt since they won't be visible for a 200 component table).

You might have a memory leak which explains why the ram isn't collected although its hard to say from your description.

We had an issue with EncodedImage's in LWUIT 1.5 which we fixed in Codename One, however as far as I understood the Nokia guys removed the usage of EncodedImage's in Codename One resources which would really balloon memory usage for images.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top