RE: [JBoss-user] Garbage Collector: Service?

2004-01-28 Thread Rod Macpherson
AH HA! This is precisely the trap that a lot of folks run in to with respect to the 
GC. That the memory remains high in an idle system for an indefinite period indicates 
that you indeed have reachable objects loitering around in the heap. Unfortunately 
forcing a GC will not release them. In fact, the existence of incremental GC pretty 
much eliminates any benefit for an application (short of a diagnostic tool) from 
executing an explicit GC. 
 
I suggest using weak references such as found in the weak hashmap. The cost is that 
you now have to reload objects on demand if they were collected and the reference set 
to null. Another approach is the memory mapped  files (FileChannel) and now that we 
are JDK 1.4 all around I am considering moving towards that. Your data looks like a 
sequential in-memory stream but in fact it is being paged in and out using a fixed 
memory window. 

-Original Message- 
From: Muraly R [mailto:[EMAIL PROTECTED] 
Sent: Tue 1/27/2004 9:23 PM 
To: [EMAIL PROTECTED] 
Cc: 
Subject: RE: [JBoss-user] Garbage Collector: Service?


Hi Rod,
The application is heavily using heavy weights(like vectors and 
hashmaps).
Though they are declared within corresponding methods only, after a 
particular operation, the memory shoots up and stays in that state forever. It never 
return to 'normal' state.
Hence thought of implementing a periodic GC.
I am aware of the 'best effort try' of the VM by calling the GC. I am 
trying various options to bring the memory to an 'affordable' state.
Hope I have cleared the requirement.
Thanks all for your replies and expecting MORE:-)
Cheers
Muraly

At 12:54 27/01/2004 -0800, you wrote:


Just curious, what is your objective in terms of a periodic GC call? 


-Original Message- 
From: Muraly R [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 26, 2004 8:34 PM 
To: [EMAIL PROTECTED] 
Subject: RE: [JBoss-user] Garbage Collector: Service?


Hi Heiko, 
Thanks for reply. 
Please bear my ignorance. Could you give a more 
detailed explanation? 
Did you mean writing a seperate class and deploy it as 
a '-service.xml' file. If then, how can I schedule this class to be run, say every 5 
mins? 
 
Thanks 
Muraly


At 09:13 23/01/2004 +0100, you wrote: 

Hi,


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


use jboss.system:type=System and there the 
runGarbageCollector call.


 Heiko





--- 
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 

winmail.dat

Re: [JBoss-user] Garbage Collector: Service?

2004-01-27 Thread Rupp, Heiko



Muraly,

  Please 
  bear my ignorance. Could you give a more detailed explanation?

  try e.g. 
  cd $JBossHome/bin
  twiddle invoke "jboss.system:type=System" 
  runGarbageCollector
   Did you mean 
  writing a seperate class and deploy it as a '-service.xml' file. If then, how 
  can I schedule this class to be run, say every 5 mins?
  Either use a scheduler like quartz to do this or use your system cron in 
  conjunction with twiddle.
  
  Heiko

Re: [JBoss-user] Garbage Collector: Service?

2004-01-27 Thread Andrew May
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-capacity50/min-capacity
	max-capacity100/max-capacity
	remover-period600/remover-period
	max-bean-life600/max-bean-life
	overager-period300/overager-period
	max-bean-age300/max-bean-age
	resizer-period400/resizer-period
	max-cache-miss-period60/max-cache-miss-period
	min-cache-miss-period1/min-cache-miss-period
	cache-load-factor0.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


RE: [JBoss-user] Garbage Collector: Service?

2004-01-27 Thread Muraly R

Hi Rod,
The
application is heavily using heavy weights(like vectors and
hashmaps).
Though
they are declared within corresponding methods only, after a particular
operation, the memory shoots up and stays in that state forever. It never
return to 'normal' state.
Hence
thought of implementing a periodic GC.
I am aware
of the 'best effort try' of the VM by calling the GC. I am trying various
options to bring the memory to an 'affordable' state.
Hope I
have cleared the requirement.
Thanks all
for your replies and expecting MORE:-)
Cheers
Muraly

At 12:54 27/01/2004 -0800, you wrote:
Just
curious, what is your objective in terms of a periodic GC
call?

-Original Message-
From: Muraly R
[mailto:[EMAIL PROTECTED]] 
Sent: Monday, January 26, 2004 8:34 PM
To: [EMAIL PROTECTED]
Subject: RE: [JBoss-user] Garbage Collector: Service?


Hi Heiko,
Thanks
for reply.
Please
bear my ignorance. Could you give a more detailed explanation?
Did
you mean writing a seperate class and deploy it as a '-service.xml' file.
If then, how can I schedule this class to be run, say every 5 mins?

Thanks
Muraly


At 09:13 23/01/2004 +0100, you wrote:
Hi,


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


use jboss.system:type=System and there the
runGarbageCollector call.


Heiko




---
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




Re: [JBoss-user] Garbage Collector: Service?

2004-01-27 Thread Muraly R

Hi Heiko,
Thanks for
the info. about quartz.
Cheers
Muraly


At 09:26 27/01/2004 +0100, you wrote:
Muraly,

 Please bear my
ignorance. Could you give a more detailed explanation?


try e.g. 


cd $JBossHome/bin


twiddle invoke jboss.system:type=System
runGarbageCollector




 Did you mean
writing a seperate class and deploy it as a '-service.xml' file. If then,
how can I schedule this class to be run, say every 5 mins?


Either use a scheduler like quartz to do this or use your system cron
in conjunction with twiddle.





Heiko



RE: [JBoss-user] Garbage Collector: Service?

2004-01-26 Thread Rod Macpherson
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-capacity50/min-capacity
max-capacity100/max-capacity
remover-period600/remover-period
max-bean-life600/max-bean-life
overager-period300/overager-period
max-bean-age300/max-bean-age
resizer-period400/resizer-period
max-cache-miss-period60/max-cache-miss-period
min-cache-miss-period1/min-cache-miss-period
cache-load-factor0.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


RE: [JBoss-user] Garbage Collector: Service?

2004-01-23 Thread Rupp, Heiko
Hi,

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

use jboss.system:type=System and there the
runGarbageCollector call.

 Heiko


---
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


[JBoss-user] Garbage Collector: Service?

2004-01-22 Thread Muraly R
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-capacity50/min-capacity
	max-capacity100/max-capacity
	remover-period600/remover-period
	max-bean-life600/max-bean-life
	overager-period300/overager-period
	max-bean-age300/max-bean-age
	resizer-period400/resizer-period
	max-cache-miss-period60/max-cache-miss-period
	min-cache-miss-period1/min-cache-miss-period
	cache-load-factor0.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