×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Nov 2004
    Posts
    8

    Memory problems with Nokia 6680 and FileConnection API example

    I tried the FileConnection API example (ImageViewer) from forum Nokia in 6680. I found that the example crashes when I try to open an image of size about 100 KB. I studied the problem a bit further and noticed that the problem arises when:

    1. Program reads a jpeg image into a byte array. The size of array is 154890 B. The size of total memory is 1000000 B and the size of free memory is 610396 B after the reading of the image into the byte array.

    2. Program tries to create an Image object from the byte array. This creation attemp fails and it throws an OutOfMemotyException. The error condition occurs on the row 80 of ImageCanvas.java:
    currentImage = Image.createImage(imageData, 0, length);

    Isn't this a bit strange because there is so much free memory available? I can also to read a lot of larger images into a byte array but it is the creation of a Image object which get the program crash?

    Br, Ilpo

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    9

    Just a plain OutOfMemory

    150k jpeg file can store 0.5-1 Mpixels image. 1Megapixel image requires at least 3Mbyte heap memory in JVM. Does your phone have this amount of memory? I really doubt

  3. #3
    Registered User
    Join Date
    Nov 2004
    Posts
    8
    Thanks for answer. Does this mean that I can't process image easily to thumbnail size because that would require a creation of the image object first?

    Br, Ilpo

Posting Permissions

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