×

Discussion Board

Results 1 to 6 of 6

Hybrid View

  1. #1
    Regular Contributor
    Join Date
    Aug 2010
    Location
    Chennai, India.
    Posts
    176

    Error: Uncaught exception java/lang/OutOfMemoryError

    Hi Experts,

    When i declare and create a instance of class in constructor of another class, i got this error
    Uncaught exception java/lang/OutOfMemoryError
    I know that this is because of storing data in a buffer more than its size and using images due large wastage of memory.

    I don't know how to solve this.? and i hardly need your help?

    Note : I'm using netbeans 6.8 and UI Framework j2mePolish.

    Help me,
    kumar.

  2. #2
    Registered User
    Join Date
    Dec 2008
    Location
    Cochin, Kerala, India
    Posts
    84

    Re: Error: Uncaught exception java/lang/OutOfMemoryError

    Hi Kumar,

    Creating an instance of a class in the constructor of another class is not an issue. The issue is due to something else.

    If possible, reply with the conceptual code snippet. This will make us solve your issue better.

    If not, please let me know.
    Is the application having many classes and all are kept in memory, without clearing them after usage?
    Is there any image handling issues? Please check that.

    Let me know further.

    Ragards
    Vineeth K.

  3. #3
    Regular Contributor
    Join Date
    Aug 2010
    Location
    Chennai, India.
    Posts
    176

    Re: Error: Uncaught exception java/lang/OutOfMemoryError

    Quote Originally Posted by vinuk4u View Post
    Hi Kumar,
    Is the application having many classes and all are kept in memory, without clearing them after usage?
    ya, Im using many clases. so i creating a instance to acces that class, i know that is not a problem. But when i comment that, it doesn't showing error!.
    when i using that object of class to access, I got this error OutOfMemoryError .

    Now, what to do?

  4. #4
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Error: Uncaught exception java/lang/OutOfMemoryError

    Quote Originally Posted by kumar1234567 View Post
    ya, Im using many clases. so i creating a instance to acces that class, i know that is not a problem. But when i comment that, it doesn't showing error!.
    when i using that object of class to access, I got this error OutOfMemoryError .

    Now, what to do?
    Probably you are loading high and multiple resources in the constructor of the class you are trying to instantiate. These are the things to be taken care :

    1. What data you wanna access from this class, in case if that is the variable like string value or something similar making that static would be preferred, rather then creating the object of the same.
    2. May be you are access some data of other class whose object is available in that class.

    Please check and revert.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  5. #5
    Nokia Developer Champion
    Join Date
    Sep 2008
    Location
    Noida, U.P.
    Posts
    1,330

    Re: Error: Uncaught exception java/lang/OutOfMemoryError

    Try this :
    try{

    // Code
    // Code
    }catch(Error e)
    {
    // TO DO with error
    }
    catch(Exception e){
    // TO DO with exception..

    }
    check the error.. handle it in catch block of error..
    thanks,
    jitu_goldie..

    KEEP TRYING..

  6. #6
    Nokia Developer Champion
    Join Date
    Sep 2008
    Location
    Noida, U.P.
    Posts
    1,330

    Re: Error: Uncaught exception java/lang/OutOfMemoryError

    Have you got the exact reason of Out of Memory Error.. Have you catched it..? Might be you are loading some heavy resources in memory while instantiation.
    thanks,
    jitu_goldie..

    KEEP TRYING..

Similar Threads

  1. Replies: 3
    Last Post: 2011-03-25, 20:22
  2. Need Suggetions regarding the Uncaught exception java/lang/IllegalArgumentException?
    By kpvrlakshmi in forum General Development Questions
    Replies: 1
    Last Post: 2009-07-10, 08:03
  3. Uncaught exception java/lang/NullPointerException.
    By bapithanc in forum General Messaging
    Replies: 5
    Last Post: 2009-06-15, 09:51
  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
  •