Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User marzieh_312's Avatar
    Join Date
    Apr 2009
    Posts
    3
    hi everybody,

    I used this line of code to create an image:

    offScreenImage = Image.createImage(getWidth(), 20 * bitmapFont.getHeight());

    I ran this code in 6270. But when application reachs this line it throws OutOfMemory error.
    This occurs only on s40 phones.
    It is OK on Nokia s60, SE and emulator.

    Can anybody help how I can fix this problem?

    thanks in advance!

  2. #2
    Super Contributor grahamhughes's Avatar
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,394
    What are the height and width?

  3. #3
    Registered User marzieh_312's Avatar
    Join Date
    Apr 2009
    Posts
    3
    its around :

    width: 217
    height: 380

  4. #4
    Super Contributor grahamhughes's Avatar
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,394
    Well... it throws an OutOfMemoryError because you don't have enough memory. In this case, you probably need around 320k free to create the image.

    You need to use less memory.

    Cheers,
    Graham.

  5. #5
    Registered User marzieh_312's Avatar
    Join Date
    Apr 2009
    Posts
    3
    thanks!

    could you please help me how i can resolve this issue?
    is there any better way or a solution for memory managment?

  6. #6
    Super Contributor grahamhughes's Avatar
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,394
    There's no magic. You just have to keep fewer images in memory. Discard any images you don't need. Avoid creating large double-buffer images like you are doing here.

    My other top-tip: when you write a game or application for mobile devices, start with a the lowest specification device you want to support. Then you won't have nasty surprises like this one.

    Cheers,
    Graham.

Similar Threads

  1. Nokia PC Connectivity能否链接到cdma手机上发送短信和其他操作?
    By bborn in forum Web Technologies and Multimedia Content- Web 技术和多媒体内容
    Replies: 2
    Last Post: 2004-05-04, 11:06
  2. What is the real problem to receive data calls with Nokia TDMA cel modems?
    By jackal_jr in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2002-12-09, 09:02
  3. What is the real problem to receive data calls with Nokia TDMA cell modem?
    By jackal_jr in forum PC Suite API and PC Connectivity SDK
    Replies: 0
    Last Post: 2002-12-04, 16:05
  4. Http connection problem in 6310i
    By teahola in forum Mobile Java General
    Replies: 1
    Last Post: 2002-10-03, 18:46

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved