aspose file tools*
The moose likes Java in General and the fly likes OutOfMemoryError: Java heap space Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "OutOfMemoryError: Java heap space" Watch "OutOfMemoryError: Java heap space" New topic
Author

OutOfMemoryError: Java heap space

Adrian Cordoba
Greenhorn

Joined: Jul 09, 2011
Posts: 13

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.


[Adrián E. Córdoba]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36453
    
  15
Yes, if you delete whatever is in the memory.

Yes, if you don’t mind poor design like that.
Jinu Vijay
Greenhorn

Joined: Sep 19, 2011
Posts: 17

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
Marshal

Joined: Mar 22, 2005
Posts: 39535
    
  27
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).


Ping & DNS - updated with new look and Ping home screen widget
Jinu Vijay
Greenhorn

Joined: Sep 19, 2011
Posts: 17

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

Joined: Oct 13, 2005
Posts: 36453
    
  15
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

Joined: Mar 22, 2000
Posts: 12675
    
    5
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

Java Resources at www.wbrogden.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: OutOfMemoryError: Java heap space
 
Similar Threads
BEA 10 Admin server out of memory issue
OutOfMemoryError
OutOfMemoryErrors and the native heap
GC Overhead limit exceeded error when reading a text file
Out of memory error:java heap space ?