tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: WebappClassLoader weak/soft reachable
Date Tue, 06 Nov 2012 21:40:51 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Konstantin,

On 11/6/12 4:19 PM, Konstantin Kolinko wrote:
> 2012/11/7 Christopher Schultz <chris@christopherschultz.net>:
>> 
>> These are the actual Exception objects I can see:
>> 
>> 3 instances of
>> org.apache.tomcat.util.buf.UDecoder$DecodeException
>> 
>> 1 instance of 
>> org.apache.tomcat.dbcp.dbcp.AbandonedTrace$AbandonedObjectException
>>
>>
>> 
(I am using a Tomcat-configured JNDI DataSource)
>> 
>> 1 instance of 
>> org.apache.naming.resources.ImmutableNameNotFoundException
>> 
> 
> The first and the last one were dealt by 
> https://issues.apache.org/bugzilla/show_bug.cgi?id=50460

Okay. Would those be triggered even when no requests go to my webapp?
Also, given that 50460 was fixed in 7.0.6 and I'm running 7.0.32, does
that suggest a regression or an unlikely cause for what I'm observing?

> I do not know about the dbcp one. It might be an issue. It
> certainly will contain a stack trace (it is what it is used for).
> I usually run with logAbandoned being turned off. Do you have
> opened connections in your pool? Do you have closeMethod="close" on
> your pool definition?

Here's my <Resource>:
   <Resource name="..."
    description="..."
	auth="Container"
	type="javax.sql.DataSource"
	maxActive="1"
	maxIdle="1"
	maxWait="10000"
	url="..."
	username="..."
	password="..."
	driverClassName="com.mysql.jdbc.Driver"
	removeAbandoned="true"
	removeAbandonedTimeout="30"
	logAbandoned="true"
    testOnBorrow="true"
    validationQuery="/* ping */ SELECT 1"
    />

So, I have no closeMethod defined for my <Resource>, so I suspect that
I get the default. I couldn't find any documentation on DBCP
closeMethod :(

>> jdk1.7.0_09.jdk Tomcat 7.0.32
>> 
> 
> I wonder whether there are any differences wrt to jdk 1.6.

I can run under jdk1.6 if that would help narrow the problem.

Back to the session issue, I was able to determine that my ClientPrefs
object is *not* the problem (or, at least, not the *only* problem)
because I removed the Filter that causes it to be placed into the
session and reloading still caused leaks. My preferences class had no
objects in memory at all (neither the data object nor the filter
itself, since I had commented it out entirely in web.xml).

Back to the WebappClassLoader, I have this as the shortest (Weak/Soft)
GC path for it:

[Weak/Soft Reachable] org.apache.catalina.loader.WebappClassLoader
  <- referent of java.util.WeakHashMap$Entry
    <- [15] of java.util.WeakHashMap$Entry[16]
      <- table of java.util.WeakHashMap
        <- loaderToCache of java.lang.reflect.Proxy [Class]

There are several other references that look like the above, and the
first object in the list (after the WebappClassLoader) does *not* say
"referent of [Weak/Soft Reachable] java.util.WeakHashMap$Entry" like
pretty much all the other objects that refer to the WebappClassLoader
(mostly classloader fields for java.lang.Class objects.

But, since the whole point of WeakHashMap is supposed to be its use of
weak references, perhaps that's not a problem?

I'm happy to provide a memory snapshot or even a screenshot if that
would help illustrate things a bit more.

Thanks for your help.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCZg+MACgkQ9CaO5/Lv0PC8YgCgmoe2JDfd23ySxBG+V04byDDg
7hUAoIMsRdPn5IoCY+Dl3KZi+8qpnc3U
=Tdc3
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message