tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 36293] - Ability to free idle ClassLoader resources
Date Mon, 22 Aug 2005 21:01:26 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36293>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36293





------- Additional Comments From junk@bbs.darktech.org  2005-08-22 23:01 -------
Shankar,

>From the Javadoc:

"Virtual machine implementations are, however, encouraged to bias against
clearing recently-created or recently-used soft references."

and

"Thus a sophisticated cache can, for example, prevent its most recently used
entries from being discarded by keeping strong referents to those entries,
leaving the remaining entries to be discarded at the discretion of the garbage
collector."

Memory has to come from somewhere. There is absolutely nothing wrong with
resource cache entries being removed by GC if it just so happens that these
references are used less often than others in the pool.

I understand your concerns, but I think we can all agree on the following
use-case: if a large image resource has not been accessed in over 12 hours, it
makes perfect sense to allow it to be garbage collected.

If you really want to guarantee that resources will remain cached for a minimum
of X minutes, simply maintain a hard reference to them and after X minutes
remove the hard reference leaving only SoftReferences in place. I've used this
many times in my own code and it works beautifully.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message