• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Exception

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space


does any one now Why this exception is coming,earlier code was working fine. Can anyone help

Thank you
 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if this error occured after adding sme piece of code to an already running application, then your new code have created a lot of objects and filled the heap size and lead to outof memory err.\

Check for

1. Any recursive calls which create a lot of objects
2. Check for the scope of the objects, may be you were trying to add objects to a static container object. Hence objects were not eligible for Garbage collection.
3. Any socket related operations that lead to consuming a lot of resources.

In simple, your code is stopping GC from doing its work !!(by keeping live references for unnecessary objects)

Let me know if you have any questions
 
Hrishikesh Hemade
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you
 
Hrishikesh Hemade
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actully i have changed JVM heap memory -Xms to something i have changed it after doing this thing it's give me the error. So anyone know how to fix it. I have removed the -Xms.

Thank you
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Xms<size> size ------> set initial Java heap size

This is a JVM parameters u set when u execute ur Program. the Xms set the initial Heap size. When u allocate very less space, u probably get this error.
 
Hrishikesh Hemade
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you,
but what is the default Xms for JVM. I have deleted the -Xms entry.

Thank you
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic