I'd agree - and I'd probably say that forcing garbage collection is likely to have an adverse effect on performance as the JVM has a much better idea of when to GC than anyone else does.

With Sun's 1.4 JVM there are now several types of Garbage Collector available, and you may find some are better suited for your application than others (in particular some of them are only recommended for systems with 4+ processors).

Here's some links I found useful:

http://java.sun.com/j2se/1.4.2/1.4.2_whitepaper.html
http://java.sun.com/docs/hotspot/index.html
http://java.sun.com/docs/hotspot/gc1.4.2/index.html

You may find the jvmstat useful to monitor heap usage and GC (plus is has some nice graphs!):

http://developers.sun.com/dev/coolstuff/jvmstat/

Although in the end I think it's something of a black art working out which works best.

-Andrew

Rod Macpherson wrote:

It is my understanding there is little point in an arbitrary GC call.
Periodic GC calls have some benefit in terms of distributing effort over
time however that is already available through JVM options. That memory
shoots up is not relevant unless and until there is insufficient memory
to satisfy an allocation request. At that point the GC will run and all
threads are suspended within the JVM so no allocation request will
occur. The GC will run as often as needed to satisfy the need for
additional memory. Out of memory will occur if and only if there are
indeed to many reachable references that cannot be released. I would add
that the heap is divided in two so that you can run out of the so-called
eden space and that can be adjusted using the JVM memory switches. Seems
to be a common misconception that forcing a GC will cure out of memory
problems. If anybody has knowledget that contradicts this by all means
post it since this seems to be an area of frequent concern. Kind of
off-topic AFA JBoss is concerned however.


-----Original Message-----
From: Muraly R [mailto:[EMAIL PROTECTED] Sent: Thursday, January 22, 2004 9:42 PM
To: [EMAIL PROTECTED]
Subject: [JBoss-user] Garbage Collector: Service?



Hi Gurus,
Is there any particular service available in JBoss to schedule
the garbage collector?


The reason for this question is our application is using heavy
weight objects like Vector, HashTable, etc. heavily. As a result of this after
a simple get query the JBoss memory shoots up and it is not returning to
is normal state.


Hence this query.

Also, for SessionBeans(Stateful/Stateless), if the
<cache-policy-conf> is configured as follows:
<cache-policy-conf>
<min-capacity>50</min-capacity>
<max-capacity>1000000</max-capacity>
<remover-period>600</remover-period>
<max-bean-life>600</max-bean-life>
<overager-period>300</overager-period>
<max-bean-age>300</max-bean-age>
<resizer-period>400</resizer-period>
<max-cache-miss-period>60</max-cache-miss-period>
<min-cache-miss-period>1</min-cache-miss-period>
<cache-load-factor>0.75</cache-load-factor>
</cache-policy-conf>


and if the ejbRemove() of the corresponding beans are populated with
code to 'null' the object will this help.
Please suggest.


Cheers
Muraly





-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration See the
breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to