Results 1 to 7 of 7
Like Tree1Likes
  • 1 Post By masijade

Thread: what is Out of memory expetion ?

  1. #1
    reddi.java97 is offline Member
    Join Date
    Sep 2013
    Posts
    2
    Rep Power
    0

    Question what is Out of memory expetion ?

    What is out of memory exception and how we can privent this ?
    Please give some example if possible


    Thanks in advance

    Regards,
    Prasad

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,848
    Rep Power
    5

    Default Re: what is Out of memory expetion ?

    It happens when Java runs out of heap space. That may commonly happen when you:

    - keep references to objects and never allow them to be garbage collections; this is as close to a memory leak as you can get in a Java program
    - try to load a gigantic pile of data into memory, for example one or multiple huge images

    How to resolve depends completely on the code that is causing it.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default Re: what is Out of memory expetion ?

    That exception is also used for other things. What comes after the ":" in that excecption message?

    It could be heap space, it could be permgen space, it could be too many open file descriptors, it could be too many native threads, and, I believe another couple of things. IOW, the exception is CALLED "OutOfMemory" but what it REALLY is, is "OutOfSystemResource".
    gimbal2 likes this.

  4. #4
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,848
    Rep Power
    5

    Default Re: what is Out of memory expetion ?

    Ha, just call it "OutOfSomething" :)

    I think it can also commonly happen when the swap is full on *nix environments.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  5. #5
    mahithreddi is offline Member
    Join Date
    Oct 2013
    Posts
    1
    Rep Power
    0

    Default Re: what is Out of memory expetion ?

    Hi,

    For Java Interview Question Bank, you visit:
    Last edited by Tolls; 10-28-2013 at 11:30 AM. Reason: Removed link

  6. #6
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,931
    Rep Power
    19

    Default Re: what is Out of memory expetion ?

    Please don't advertise your own site here.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  7. #7
    ArnavKumar is offline Member
    Join Date
    Oct 2013
    Posts
    11
    Rep Power
    0

    Default Re: what is Out of memory expetion ?

    you should check it yourself

Similar Threads

  1. Replies: 2
    Last Post: 08-20-2012, 06:38 PM
  2. Replies: 1
    Last Post: 07-18-2011, 04:24 PM
  3. Replies: 2
    Last Post: 08-21-2008, 07:33 PM
  4. Out of memory
    By mew in forum New To Java
    Replies: 1
    Last Post: 01-20-2008, 08:55 AM

Posting Permissions

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