×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    8

    Failed to open image.. OutOfMemoryException on S40 device

    Hello...
    may i ask something?
    i want to open image using app...
    i use code from wiki sample code: http://www.developer.nokia.com/Commu...ery_in_Java_ME

    when i try to open image with little size, its work just fine..
    but when i try to open image from gallery (image that user take using camera) it keep giving me OutOfMemoryException.. how can I fix this? because one of my app feature is to open image from gallery..
    note: i try using C2 device, which has 2mpx camera..

    thanks a lot

  2. #2
    Nokia Developer Expert
    Join Date
    Aug 2011
    Posts
    555

    Re: Failed to open image.. OutOfMemoryException on S40 device

    Hi elisafina,

    The error indicates that you ran out of memory. The series 40 phones have very limited resources. The heap memory available for Java is 2 MB. You can find more information regarding hardware characteristics here:

    http://library.developer.nokia.com/i...833C0E2C7.html

    A few considerations when displaying images on Series 40, is that you don't really need a high resolution image, because the screen is much smaller than the high-end devices. If for example you are capturing an image with the device's Camera, on C2-01, setting the capture quality to the lowest i.e. 0.1MP (240x320), creates an image that can be opened successfully without consuming all the phone's memory. Since the device's screen resolution is the same (240x320), you don't loose in displaying quality.
    Last edited by skalogir; 2011-11-21 at 08:25.

  3. #3
    Registered User
    Join Date
    Apr 2011
    Posts
    8

    Re: Failed to open image.. OutOfMemoryException on S40 device

    so, is this really impossible if i want to open an image that is saved in user gallery? because i think, we don't know user using 2mpx camera quality or 0.1mpx and we can't force user to take picture using 0.1mpx quality, isn't it?

    Thanks

  4. #4
    Regular Contributor
    Join Date
    Mar 2011
    Location
    Pune,Maharashtra,India
    Posts
    92

    Re: Failed to open image.. OutOfMemoryException on S40 device

    Quote Originally Posted by elisafina1205 View Post
    so, is this really impossible if i want to open an image that is saved in user gallery? because i think, we don't know user using 2mpx camera quality or 0.1mpx and we can't force user to take picture using 0.1mpx quality, isn't it?

    Thanks
    Try to get filesize in long variable instead of using integer
    Regards,
    Pradip

  5. #5
    Nokia Developer Expert
    Join Date
    Aug 2011
    Posts
    555

    Re: Failed to open image.. OutOfMemoryException on S40 device

    This article here:

    http://www.developer.nokia.com/Commu...y_Usage_Images

    describes in detail why even a small image that is resident in the heap can thrown an out of memory exception.

Similar Threads

  1. Failed to open image that save using FileConnection
    By elisafina1205 in forum Mobile Java General
    Replies: 2
    Last Post: 2011-11-18, 03:12
  2. upload image from camera cause OutOfMemoryException on S40 device
    By elisafina1205 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2011-07-08, 08:57
  3. Replies: 4
    Last Post: 2010-03-01, 09:51
  4. OutOfMemoryException
    By thechameleon in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2009-10-04, 16:19
  5. 6280: OutOfMemoryException when playing an ebedded 3GP file?
    By neilskinner in forum Mobile Java General
    Replies: 10
    Last Post: 2007-02-11, 13:50

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×