×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Jul 2012
    Location
    India
    Posts
    103

    LWUIT HtmlComponent out of memory exception

    Hiii

    i want to display an image and Description from Rss File on LWUIT Form Screen here my Code:

    HTMLComponent com=new HTMLComponent();
    com.setBodyText(detailNews.getDescription());
    form2.addComponent(com);

    In place of detailNews.getDescription(),the string coming form an Rss URL in a loop is

    <p><img border="1" align="left" width="150" vspace="2" hspace="2" height="159" src="/tmdbuserfiles/Prithvi2_launch1(3).jpg" alt="Prithvi II, ballistic missile, DRDO, armed forces,Chandipur, Balasore district, Odisha State" />The Strategic Forces
    Command of the armed forces successfully flight-tested the surface-to-surface Prithvi II missile from Chandipur in Balasore </P>

    if i execute, i am facing the application has unexpectedly quit because ,it ran out of memory exception

  2. #2
    Nokia Developer Expert
    Join Date
    May 2012
    Location
    Espoo
    Posts
    224

    Re: LWUIT HtmlComponent out of memory exception

    Hi Pavanragi,

    S40 Java ME has the restriction of Maximum heap Size 2-4 MB (depends on the device), and image and description from RSS file might easily cross above limit. I strongly suspect that image size is too big(more than 2 MB) or enough to through out of memory while loading.

    Also note that HTMLComponent of LWUIT is not yet optimized for S40, it might available in the future.

  3. #3
    Registered User
    Join Date
    Jul 2012
    Location
    India
    Posts
    103

    Re: LWUIT HtmlComponent out of memory exception

    Hi Bandarap,
    i dont require image to be displayed,i want only the description to be displayed on my form,for that i have used ,HTMLCOMPONENT reference.setShowImages(false);,even this also not working


    Quote Originally Posted by bandarap View Post
    Hi Pavanragi,

    S40 Java ME has the restriction of Maximum heap Size 2-4 MB (depends on the device), and image and description from RSS file might easily cross above limit. I strongly suspect that image size is too big(more than 2 MB) or enough to through out of memory while loading.

    Also note that HTMLComponent of LWUIT is not yet optimized for S40, it might available in the future.

  4. #4
    Nokia Developer Expert
    Join Date
    May 2012
    Location
    Espoo
    Posts
    224

    Re: LWUIT HtmlComponent out of memory exception

    Hi pavanragi,

    I used following code and works fine without out of memory exception.
    Display.init(this);
    Form f = new Form("Hello, LWUIT!");
    String html="<p><img border=\"1\" align=\"left\" width=\"150\" vspace=\"2\" hspace=\"2\" height=\"159\" src=\"/tmdbuserfiles/Prithvi2_launch1(3).jpg\" alt=\"Prithvi II, ballistic missile, DRDO, armed forces,Chandipur, Balasore district, Odisha State\" />The Strategic Forces Command of the armed forces successfully flight-tested the surface-to-surface Prithvi II missile from Chandipur in Balasore </P>";
    HTMLComponent com=new HTMLComponent();
    com.setBodyText(html);
    com.setShowImages(false);
    f.addComponent(com);
    f.show();
    I tested above code in S40 SDK 2.0 beta with LWUIT (S40-with-themes.jar) downloaded from here https://projects.developer.nokia.com..._for_Series_40.

    Please check that you might have created too many objects and left without set to null after it is used.

    Also close network objects after using it so that memory will be released and you won’t get out of memory exception.

  5. #5
    Nokia Developer Expert
    Join Date
    May 2012
    Location
    Espoo
    Posts
    224

    Re: html text extraction in j2me without any html tags and special charcters

    See LWUIT HTMLDemo for more info: https://projects.developer.nokia.com.../HTMLDemo.java
    Last edited by wizard_hu_; 2012-08-29 at 12:05. Reason: Two threads are merged, just the extra link kept here.

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,752

    Re: html text extraction in j2me without any html tags and special charcters

    Bandarap, just a side note: when testing, did you have some large image(s) available?

  7. #7
    Registered User
    Join Date
    Jul 2012
    Location
    India
    Posts
    103

    Re: LWUIT HtmlComponent out of memory exception

    Hi Bandarap
    you said that you tested this simple example,that time Have you displayed with an image on the Emulator?pls..give a reply soon..



    Quote Originally Posted by bandarap View Post
    Hi pavanragi,

    I used following code and works fine without out of memory exception.


    I tested above code in S40 SDK 2.0 beta with LWUIT (S40-with-themes.jar) downloaded from here https://projects.developer.nokia.com..._for_Series_40.

    Please check that you might have created too many objects and left without set to null after it is used.

    Also close network objects after using it so that memory will be released and you won’t get out of memory exception.
    Last edited by pavanragi; 2012-10-11 at 12:18.

Similar Threads

  1. Replies: 11
    Last Post: 2013-02-19, 08:51
  2. out of memory exception
    By tvgece in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2012-03-12, 07:14
  3. LWUIT exception
    By kavitha@i-waves.com in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2010-08-29, 07:00
  4. Out of Memory Exception in
    By honest_success in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2009-09-10, 20:14
  5. memory out exception
    By knawaz in forum Mobile Java General
    Replies: 6
    Last Post: 2008-07-18, 06:29

Posting Permissions

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