×

Discussion Board

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

    LWUIT Uncaught exception: java.lang.OutOfMemoryError(stack trace incomplete)

    I developed an Rss Application using LWUIT Tabs,i want to display Rss Feed Titles and images on my Lwuit Tab screen,but when i run my application i am able to display three List (title with image)items Sucessfully,after that i am facing java.lang.OutOfMemoryError(stack trace incomplete) Eventhough there are list items present?can any one help......

    Here my Code:

    public class Process {
    protected XMLMidlet midlet;

    Form form1;
    Image image;
    Tabs tabs;
    private List myNewsList;
    private Vector topnews;
    private Vector topstory;
    private Command cmdExit;
    private Command m_backCommand;
    private List newsList;
    private Form form2;
    Process(XMLMidlet midlet) throws IOException {
    this.midlet=midlet;
    topnews = new Vector();
    topstory = new Vector();
    tabs = new Tabs();
    form1 = new Form();
    form2=new Form();
    try {
    newsList = new List(topnews);
    newsList.setScrollVisible(false);
    newsList.setRenderer(new NewsListCellRenderer());
    m_backCommand = new Command("Back");
    cmdExit = new Command("EXIT");
    tabs.addTab("Topstory", newsList);
    form1.addComponent(BorderLayout.CENTER, tabs);
    }
    catch(Exception e){
    e.printStackTrace();
    } }

    public void process() {
    try{
    String url = "http://www.teluguone.com/news/tonefeeds/news/news-1.rss";

    form1.show();
    ParseThread myThread = new ParseThread(this);
    myThread.getXMLFeed(url);

    } catch (Exception e) {

    }

    }
    public void addNews(News newsItem) {

    try{
    topnews.addElement(newsItem);
    newsList.addActionListener(new ActionListener() {

    public void actionPerformed(ActionEvent ae) {

    List source = (List) ae.getSource();
    News selectedNewsItem = (News) source.getSelectedItem();
    if (selectedNewsItem != null) {
    displayCompleteNewsScreen(selectedNewsItem);

    }

    }


    });
    }
    catch(OutOfMemoryError r){

    }
    form1.show();


    }


    private void displayCompleteNewsScreen(News detailNews) {

    try{
    form2.removeAll();
    form2.repaint();
    form2.addCommand(m_backCommand);
    form2.addCommandListener(new ActionListener() {

    public void actionPerformed(ActionEvent ae) {
    form1.show();
    }
    });

    HTMLComponent com=new HTMLComponent();
    com.setPreferredSize(new Dimension(300,300));
    com.setShowImages(false);

    com.setBodyText(detailNews.getDescription());
    form2.addComponent(com);
    //form2.addComponent(big);
    }
    catch(OutOfMemoryError e){

    }
    form2.show();

    }



    }

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,752

    Re: LWUIT Uncaught exception: java.lang.OutOfMemoryError(stack trace incomplete)

    Although you have not mentioned the device you are using, generally speaking your 3rd image (pawan kalyan cgtr Dialogues(2).jpg) is just huge, 168 kilobytes for download and 700 kilobytes to view. Considering that even the smaller images are around 90 kilobytes when uncompressed, you can easily run out of heap on a device with a 1-2 megabytes restriction.

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

    Re: LWUIT Uncaught exception: java.lang.OutOfMemoryError(stack trace incomplete)

    Hi Wizard,
    thanks for reply,i have tested with Nokia SDK 1.1 and SDK 3.0.5 Device Manager,but actually if i remove HtmlComponent Class from my displaycompleteNewsScreen() method,then i am able to display all my list details succeefully....
    but when i run my application initially list will be loaded, that time there is no question of executing displaycompleteNewsScreen() method ,This method will get execute only if i click on any list item?but if i place HTMLComponent class then i am facing Outofmemory Exception?can you give your suggestion?
    Last edited by pavanragi; 2012-10-04 at 05:21.

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

    Re: LWUIT Uncaught exception: java.lang.OutOfMemoryError(stack trace incomplete)

    Hi Wizard,
    I am not able to solve my issue regarding with OutOfMemory Exception,i am new to javame,Can you suggest Is there any API available in javame for my Requirement(http://www.teluguone.com/news/tonefeeds/news/news-1.rss) or How can i proceed with this one?





    Quote Originally Posted by pavanragi View Post
    Hi Wizard,
    thanks for reply,i have tested with Nokia SDK 1.1 and SDK 3.0.5 Device Manager,but actually if i remove HtmlComponent Class from my displaycompleteNewsScreen() method,then i am able to display all my list details succeefully....
    but when i run my application initially list will be loaded, that time there is no question of executing displaycompleteNewsScreen() method ,This method will get execute only if i click on any list item?but if i place HTMLComponent class then i am facing Outofmemory Exception?can you give your suggestion?

  5. #5
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: LWUIT Uncaught exception: java.lang.OutOfMemoryError(stack trace incomplete)

    Try to test it on some real target device or check the max memory settings on the SDK you are using for testing.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

Similar Threads

  1. Replies: 11
    Last Post: 2013-02-19, 08:51
  2. Error: Uncaught exception java/lang/OutOfMemoryError
    By kumar1234567 in forum Mobile Java Networking & Messaging & Security
    Replies: 5
    Last Post: 2011-07-06, 12:32
  3. Replies: 3
    Last Post: 2011-03-25, 20:22
  4. SUDDENLY ... Uncaught exception java/lang/OutOfMemoryError
    By mbenz1 in forum Mobile Java General
    Replies: 1
    Last Post: 2008-03-15, 23:25
  5. Replies: 2
    Last Post: 2007-09-18, 08:47

Posting Permissions

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