File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

OutOfMemoryError: Java heap space

 
Adrian Cordoba
Greenhorn
Posts: 18
Java Linux Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, all!

Can a Java VM remain running after a OutOfMemoryError: Java heap space?
Is that possible?
(I'm supporting Java applications, and that is they are reporting.)

Thank you, in advance.

 
Campbell Ritchie
Sheriff
Pie
Posts: 47262
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, if you delete whatever is in the memory.

Yes, if you don’t mind poor design like that.
 
Jinu Vijay
Greenhorn
Posts: 20
Eclipse IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Following on what Campbell mentions (very crisply!!!) ...

You have 2 options that you could work on:
1. Remedy the situation by increasing the heap size using the JVM option -Xmx512M
2. Use some profiler to analyse your application code to find the source of the memory leakage and fix it asap!

 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jinu Vijay wrote:Use some profiler to analyse your application code to find the source of the memory leakage

This assumes that there is a leak. It could just be that the app needs that much memory (or that the algorithms currently used by the app need that much memory).
 
Jinu Vijay
Greenhorn
Posts: 20
Eclipse IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:
Jinu Vijay wrote:Use some profiler to analyse your application code to find the source of the memory leakage

This assumes that there is a leak. It could just be that the app needs that much memory (or that the algorithms currently used by the app need that much memory).


Indeed an assumption, but that based on experience! 2 reasons:
1. Production systems typically have more that enough resources
2 Ask support teams ... it always the development team's code that is faulty

Cheers!

 
Campbell Ritchie
Sheriff
Pie
Posts: 47262
52
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jinu Vijay wrote: . . .
2 Ask support teams ... it always the development team's code that is faulty

Cheers!

 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13045
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can a Java VM remain running after a OutOfMemoryError: Java heap space?


Throwing that Error could have left an application in a complete mess - best practice is to not try to continue running.

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic