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
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.
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=bandarap;902447]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.[/QUOTE]
Re: LWUIT HtmlComponent out of memory exception
Hi pavanragi,
I used following code and works fine without out of memory exception.
[QUOTE] 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();
[/QUOTE]
I tested above code in S40 SDK 2.0 beta with LWUIT (S40-with-themes.jar) downloaded from here [url]https://projects.developer.nokia.com/LWUIT_for_Series_40[/url].
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.
Re: html text extraction in j2me without any html tags and special charcters
See LWUIT HTMLDemo for more info: [url]https://projects.developer.nokia.com/LWUIT_for_Series_40/browser/Apps/LWUITDemo/src/com/sun/lwuit/uidemo/HTMLDemo.java[/url]
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?
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=bandarap;902545]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 [url]https://projects.developer.nokia.com/LWUIT_for_Series_40[/url].
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.[/QUOTE]