commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diego Cueva <>
Subject RE: Metrics for commons DBCP
Date Tue, 02 Aug 2005 20:15:42 GMT
Thanks a lot for your answer, but the result is always 0.

I am applying your suggestion in this way:

libre = Runtime.getRuntime().freeMemory();
total = Runtime.getRuntime().totalMemory();
usada = total - libre;
org.apache.commons.dbcp.BasicDataSource o = new
Log.logEvent("MEM T U L: "+ total + "  "+ usada+ "  "+libre+ 
" act="+o.getNumActive() + " idl="+o.getNumIdle());
But the result is always 0, this is a log extract example from a test

2005-08-02 14:55:23|MEM T U L: 48746496  28956352  19790144 act=0 idl=0
2005-08-02 14:55:23|MEM T U L: 48746496  27750072  20996424 act=0 idl=0
2005-08-02 14:55:25|MEM T U L: 48746496  25458960  23287536 act=0 idl=0

I am using commons-dbcpool embedded in Hibernate, with the next

	<!--  connection pool -->
	<property name="dbcp.maxActive">10</property>
	<property name="dbcp.whenExhaustedAction">2</property>
	<property name="dbcp.maxWait">20</property>
	<property name="dbcp.maxIdle">20</property>

	<!-- prepared statement cache -->
	<property name="">10</property>
	<property name="">2</property>
	<property name="">20</property>
	<property name="">20</property>


-----Original Message-----
From: Pramodh Peddi [] 
Sent: Tuesday, August 02, 2005 14:17
To: Jakarta Commons Users List
Subject: RE: Metrics for commons DBCP

org.apache.commons.dbcp.BasicDataSource has methods like getNumActive(),
getNumIdle(), etc methods.

Did I answer your question?


-----Original Message-----
From: Diego Cueva [] 
Sent: Tuesday, August 02, 2005 10:30 AM
To: 'Jakarta Commons Users List'
Subject: Metrics for commons DBCP


Somebody knows how I can know the amounts of DB connections are being
used in a determinate moment.

I need this information to carry of a monitoring of my app, part of
monitoring is know how much connections are free and used.

Thanks a lot.



TODO1 SERVICES, INC. -TODO1- es la propietaria de la información
en este mensaje y sus anexos, que puede tener carácter confidencial y ha
sido enviada para uso exclusivo del destinatario intencional. Si usted
recibido este mensaje por error, por favor informe de ello al remitente
a la
mayor brevedad y elimine este mensaje y sus anexos. Está prohibido su
distribución, divulgación o almacenamiento, salvo autorización escrita
TODO1. Todo mensaje enviado y/o recibido por TODO1 es monitoreado por
motivos operativos y actuando de acuerdo con prácticas de negocio y de
seguridad legítimas.

TODO1 SERVICES, INC. -TODO1- is the proprietary of the information
herein and its attachments, that may have confidential character and has
been sent to the intended recipient only. If you are not the intended
recipient, please contact the sender immediately by replying to this
and delete the message and its attachments. The use, forward,
record or retention of this message for any purpose whatsoever, is
prohibited, unless prior written authorization from TODO1. E-mails to
from TODO1 are monitored for operational reasons and in accordance with
lawful business and security practices.

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message