File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Exception" Watch "Exception" New topic
Author

Exception

Hrishikesh Hemade
Greenhorn

Joined: Mar 17, 2005
Posts: 9
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
Lakshmanan Arunachalam
Ranch Hand

Joined: Nov 02, 2005
Posts: 99
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


Regards<br />Lakshmanan<br />IBM-OOAD & UML, SCEA-I
Hrishikesh Hemade
Greenhorn

Joined: Mar 17, 2005
Posts: 9
Thank you
Hrishikesh Hemade
Greenhorn

Joined: Mar 17, 2005
Posts: 9
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
Sri Ram
Ranch Hand

Joined: Oct 03, 2005
Posts: 118
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

Joined: Mar 17, 2005
Posts: 9
Thank you,
but what is the default Xms for JVM. I have deleted the -Xms entry.

Thank you
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception