| View previous topic :: View next topic |
| Author |
Message |
miss_duke
Joined: 15 Jun 2009 Posts: 19
|
Posted: Mon Jun 15, 2009 3:21 pm Post subject: Monitoring Glassfish memory usage over time |
|
|
My web application runs on Glassfish server, it works fine except it crashes time to time (about once in a month) after throwing "OutOfMemoryError".
I just want to monitor the memory usage by Glassfish server over time, how can I do that?
Thanks. |
|
| Back to top |
|
 |
Tomas Hurka Posted via mailing list.
|
Posted: Tue Jun 16, 2009 8:33 am Post subject: Monitoring Glassfish memory usage over time |
|
|
Hi,
On 15 Jun 2009, at 17:21, miss_duke wrote:
| Quote: | My web application runs on Glassfish server, it works fine except it
crashes time to time (about once in a month) after throwing
"OutOfMemoryError".
I just want to monitor the memory usage by Glassfish server over
time, how can I do that?
| You can use VisualVM to monitor the memory usage. VisualVM is included
in JDK 6 update 7 and newer. For OutOfMemoryError you can use
-XX:+HeapDumpOnOutOfMemoryError commandline flag, which will cause JVM
to dump heap on OutOfMemoryError. You can use NetBeans Profiler,
VisualVM or jhat to open such heap dump.
Bye,
--
Tomas Hurka <mailto:address-removed>
NetBeans Profiler http://profiler.netbeans.org
VisualVM http://visualvm.dev.java.net
Software Engineer, Developer Platforms Group
Sun Microsystems, Praha Czech Republic
---------------------------------------------------------------------
To unsubscribe, e-mail: address-removed
For additional commands, e-mail: address-removed |
|
| Back to top |
|
 |
miss_duke
Joined: 15 Jun 2009 Posts: 19
|
Posted: Wed Sep 02, 2009 4:18 pm Post subject: |
|
|
Hi,
Are there any ways to save the Glassfish application server from crash on outOfMemoryError?
Can we immediately and automatically empty the contents of the heap on outOfMemoryError? (After making the heap dump)
Thanks. |
|
| Back to top |
|
 |
Jiri Sedlacek Posted via mailing list.
|
Posted: Wed Sep 02, 2009 4:51 pm Post subject: Monitoring Glassfish memory usage over time |
|
|
Hi,
the OutOfMemoryError means that the heap is full and the garbage collector isn't able to empty it.
If you are using some caches that can eventually be released near to the OOME then use weak/soft
references to hold the caches - the garbage collector will clear the caches if the heap is near to
its limit.
Jiri
miss_duke wrote:
| Quote: | Hi,
Are there any ways to save the Glassfish application server from crash on outOfMemoryError?
Can we immediately and automatically empty the contents of the heap on outOfMemoryError? (After making the heap dump)
Thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: address-removed
For additional commands, e-mail: address-removed
|
---------------------------------------------------------------------
To unsubscribe, e-mail: address-removed
For additional commands, e-mail: address-removed |
|
| Back to top |
|
 |
miss_duke
Joined: 15 Jun 2009 Posts: 19
|
Posted: Thu Sep 03, 2009 5:39 am Post subject: |
|
|
If we cannot avoid server crash on outOfMemoryError, this has to be considered a weak point in Java technology. An enterprise production quality technology shouldn't be like that!!
How can we consider Java as the technology for "MISSION CRITICAL" applications?
Thanks. |
|
| Back to top |
|
 |
Replogle, Andrew Posted via mailing list.
|
Posted: Thu Sep 03, 2009 2:45 pm Post subject: Monitoring Glassfish memory usage over time |
|
|
The weak point is not in java technology but the application you are using.
If you emptied out the heap, you'd make any session attached to the vm completely ineffective rendering the same user experience as a crashed vm.
If you knew which objects to exclusively empty out of the heap and keep everything that's in use, you wouldn't be having this issue as that's what GC does.
There is a garbage collection process that goes and reaps objects no longer referenced. Your issue is either that A) your application footprint is larger then the heap you're providing it or B) your code, or third-party code you're including is not releasing objects after it is done with them. This makes the GC reaper pass over them when it goes to clean up the heap.
You could buy yourself time by forcing a full gc and clearing up some space if there is any to free up, but this is not a solution. You need to take a heap dump, analyze it for leak suspects and fix your application where it's leaking references. Simply altering the environment it runs in is not a solution.
If you're not using session replication and load-balancing in your environment, its not considered enterprise anyway.
I suggest reading the following to gain stronger insight into how to architect and administer your environments:
http://www.codingthearchitecture.com/2008/01/14/jvm_lies_the_outofmemory_myth.html
http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html
http://java.sun.com/developer/technicalArticles/J2SE/monitoring/
reference:
http://blogs.sun.com/watt/resource/jvm-options-list.html
-----Original Message-----
From: miss_duke [mailto:address-removed]
Sent: Thursday, September 03, 2009 12:39 AM
To: address-removed
Subject: [profiler] Monitoring Glassfish memory usage over time
If we cannot avoid server crash on outOfMemoryError, this has to be considered a weak point in Java technology. An enterprise production quality technology shouldn't be like that!!
How can we consider Java as the technology for "MISSION CRITICAL" applications?
Thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: address-removed
For additional commands, e-mail: address-removed
---------------------------------------------------------------------
To unsubscribe, e-mail: address-removed
For additional commands, e-mail: address-removed |
|
| Back to top |
|
 |
markwright789
Joined: 30 May 2011 Posts: 15
|
Posted: Mon May 30, 2011 9:55 am Post subject: |
|
|
| If you are applying some caches that can finally be released near to the OOME then apply weak references to hold the caches the garbage collector will clear the caches if the heap is near to its limit. |
|
| Back to top |
|
 |
girlsgames
Joined: 10 Dec 2011 Posts: 2
|
Posted: Sat Dec 10, 2011 4:43 am Post subject: |
|
|
| I'm too |
|
| Back to top |
|
 |
girlsgames
Joined: 10 Dec 2011 Posts: 2
|
Posted: Sat Dec 10, 2011 4:47 am Post subject: |
|
|
| I'm too |
|
| Back to top |
|
 |
zeeshanam
Joined: 26 Dec 2011 Posts: 1
|
Posted: Mon Dec 26, 2011 4:58 pm Post subject: |
|
|
I am too..  |
|
| Back to top |
|
 |
|