• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

"Checking for expired resources" Log Entry

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys. We keep getting this in our Tomcat catalina.out log file:

6283020 [Timer-135] DEBUG com.mchange.v2.resourcepool.BasicResourcePool - Checking for expired resources - Mon Oct 29 12:56:52 GMT 2007 [com.mchange.v2.resourcepool.BasicResourcePool@16f3619]
6283020 [Timer-135] DEBUG com.mchange.v2.resourcepool.BasicResourcePool - BEGIN check for expired resources. [com.mchange.v2.resourcepool.BasicResourcePool@16f3619]
6283020 [Timer-135] DEBUG com.mchange.v2.resourcepool.BasicResourcePool - FINISHED check for expired resources. [com.mchange.v2.resourcepool.BasicResourcePool@16f3619]

I believe this is from JForum, as the rest of our applications don't use log4j as far as I'm aware. We are using SSO and a session timeout of 30 min. What does this log entry mean? Thanks a lot for any help!
[originally posted on jforum.net by akindo]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A quick guess would be that this is the code that handle DB connection pooling doing some housekeeping. With DB connection pooling, there is a "pool manager" that keeps a set of open connections to the DB and hand them out to applications as needed.

This helps performance because it eliminates the high overhead of establishing a connection to the database server for each request. This can be 30-50% of the time/CPU cycles on a non-pooled connection.

One issue that a pool manager needs to deal with is "stale" connections. E.g., connections that might have timed out (expired) due to inactivity. That is what these messages seem to be indicating.

FWIW, they are DEBUG messages. If you want to cut back on info logged, you can change your logging setting to INFO or higher. (Or get fancy and set levels based on package names, e.g. com.mchange.v2 to info).
[originally posted on jforum.net by monroe]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wauw, cheers for the speedy reply.

You are probably right, seems logical about checking for DB connections. We did enable connection pooling for this JForum webapp. Once we get one of these entries, they seem to continue (I can see this in my Eclipse Console window, get a new entry every second or so). I see we are also getting:

2834072 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG com.mchange.v2.resourcepool.BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@312cbb [managed: 8, unused: 7, e
xcluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@15e8edc)

But I suppose that's just the DB classes doing their work.

In order to get rid of these log entries, in web.xml, I have set JForum Controller's debug element to to false:

<init-param>
<param-name>debug</param-name>
<param-value>false</param-value>
</init-param>

and in log4j.xml I have set all logging to only report fatal output:

<category name="org.jgroups">
<priority value="fatal"/>
<appender-ref ref="jforum-stdout"/>
</category>

<category name="org.jboss">
<priority value="fatal"/>
<appender-ref ref="jforum-stdout"/>
</category>

<category name="net.jforum">
<priority value="fatal" />
<appender-ref ref="jforum-stdout" />
</category>

<category name="freemarker">
<priority value="fatal"/>
<appender-ref ref="jforum-stdout"/>
</category>

However, I'm still getting all the

6283020 [Timer-135] DEBUG com.mchange.v2.resourcepool.BasicResourcePool - Checking for expired resources - Mon Oct 29 12:56:52 GMT 2007 [com.mchange.v2.resourcepool.BasicResourcePool@16f3619]
6283020 [Timer-135] DEBUG com.mchange.v2.resourcepool.BasicResourcePool - BEGIN check for expired resources. [com.mchange.v2.resourcepool.BasicResourcePool@16f3619]
6283020 [Timer-135] DEBUG com.mchange.v2.resourcepool.BasicResourcePool - FINISHED check for expired resources. [com.mchange.v2.resourcepool.BasicResourcePool@16f3619]

messages. Thanks for any help here.
[originally posted on jforum.net by akindo]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<category name="com.mchange">
<priority value="fatal" />
<appender-ref ref="jforum-stdout" />
</category>

[originally posted on jforum.net by monroe]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone have any ideas here? Would be great, as our Tomcat log file is getting clogged up.
[originally posted on jforum.net by akindo]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for this one.
[originally posted on jforum.net by akindo]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!