wood burning stoves 2.0*
The moose likes Java Micro Edition and the fly likes Problem with nokia S40 series Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Problem with nokia S40 series" Watch "Problem with nokia S40 series" New topic
Author

Problem with nokia S40 series

Kevin Onik
Ranch Hand

Joined: Sep 10, 2003
Posts: 30
Hi everyone.
I have developped an application for mobile banking ...
The problem is it works fine on any SonyErricson and nokia phones except nokia S40 series .

The error is : Out of memory error

I cash images into ram at startup (in an array of Images exactly 150 images ) everything goes fine except S40 that stops loading images to memory with the mentioned Exception !
I use the memory profiler and it shows that the maximum JVM used ram is about 240kb and I know the spec for the phone I'm testing the app on it (Nokia 5310) has a limit of 2mb heap size.

what do you suggest???


"The greatest pleasure in life is doing what people say you cannot do." --Walter Bagehot<p>SCJP 1.4<br />SCWCD 1.3</p>
Syam Sathyan George
Ranch Hand

Joined: Apr 26, 2006
Posts: 64
I see from your post a 150 image array, this is bad.
A 2mb heap is extravagant, and i havent seen it in s40(maybe the phone you are trying is exceptional)

Load the images in a separate thread and log the exception stack trace to see how many got loaded.Then that much is the devices memory barrier.

Why not write the unused or less frequently used to RecordStore.
Reload them when needed, i assume that you are not going to display all the 150 images on same screen


Syam.Sathyan.George
(My boss is a Jewish carpenter)
Kevin Onik
Ranch Hand

Joined: Sep 10, 2003
Posts: 30
Hi Syam and thanks for your reply.

Originally posted by Syam Sathyan:
I see from your post a 150 image array, this is bad.
A 2mb heap is extravagant, and i havent seen it in s40(maybe the phone you are trying is exceptional)


All of 150 images only occupy 220kb of ram wich is very low but I have a greater performance when displaying them. compare 220kb to the 2mb of heap size! It's only the 10% of heap size
Originally posted by Syam Sathyan:
Load the images in a separate thread and log the exception stack trace to see how many got loaded.Then that much is the devices memory barrier.


Thanks man , I will try that.
[ May 11, 2008: Message edited by: Kamyar Onikzeh ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with nokia S40 series