On 12/02/2010 02:52, Bill Barker wrote:
> 
> 
> <ma...@apache.org> wrote in message
> news:20100211180956.bfd5f2388...@eris.apache.org...
>> Author: markt
>> Date: Thu Feb 11 18:09:08 2010
>> New Revision: 909097
>>
>> URL: http://svn.apache.org/viewvc?rev=909097&view=rev
>> Log:
>> Improved memory leak prevention for resource ResourceBundle

<snip/>

>> +    private void clearReferencesResourceBundles() {
>> +        // Get a reference to the cache
>> +        try {
>> +            Field cacheListField =
>> +                ResourceBundle.class.getDeclaredField("cacheList");
>> +            cacheListField.setAccessible(true);
>> +
> 
> I don't see anywhere in the documentation that says that there is a
> cacheList field.  Have you tried this with a non-Sun JVM?

It works with the 1.6.0 SR7 64-bit JDK on linux from IBM. I haven't
tested any further.

Granted it is undocumented, but most of the memory leak protection
involves using reflection to dig at internals that aren't normally
exposed there is always going to be a risk. This should be fairly same
as we don't need to dig too far to get to what we need.

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to