[Fwd: Second Code Review for WeakReference leak in the Logging API (6942989)]
Daniel D. Daugherty
daniel.daugherty at oracle.com
Wed Jun 23 10:35:45 PDT 2010
Joe,
I think you might want this one for OpenJDK6. That will allow Google
to sync their fix with mine.
Only two changes were made after the second round of code review:
*** LogManager.java Fri Jun 18 09:51:33 2010
---
/work/shared/bug_hunt/jdk7/exp/src/share/classes/java/util/logging/LogManager.java
Wed Jun 23 11:29:49 2010
***************
*** 423,430 ****
// that have been GC'ed.
private final ReferenceQueue<Logger> loggerRefQueue
= new ReferenceQueue<Logger>();
!
! // Package-level method.
// Helper class for managing WeakReferences to Logger objects.
//
// LogManager.namedLoggers
--- 423,430 ----
// that have been GC'ed.
private final ReferenceQueue<Logger> loggerRefQueue
= new ReferenceQueue<Logger>();
!
! // Package-level inner class.
// Helper class for managing WeakReferences to Logger objects.
//
// LogManager.namedLoggers
***************
*** 454,460 ****
name = logger.getName(); // save for namedLoggers cleanup
}
!
// dispose of this LoggerWeakRef object
void dispose() {
if (node != null) {
--- 454,460 ----
name = logger.getName(); // save for namedLoggers cleanup
}
!
// dispose of this LoggerWeakRef object
void dispose() {
if (node != null) {
jcheck caught trailing whitespace and one comment correction caught
by Tony P.
Let me know if you want this fix...
Dan
-------- Original Message --------
Subject: Second Code Review for WeakReference leak in the Logging API
(6942989)
Date: Fri, 18 Jun 2010 13:25:55 -0600
From: Daniel D. Daugherty <daniel.daugherty at oracle.com>
Reply-To: daniel.daugherty at oracle.com
To: serviceability-dev at openjdk.java.net
<serviceability-dev at openjdk.java.net>, hotspot-runtime-dev at openjdk.java.net
Greetings,
I have a new version of my fix for the WeakReference leak in the
Logging API done. This version uses ReferenceQueues; thanks to Eamonn
McManus, Jeremy Manson and Tony Printezis for their insights on using
ReferenceQueues. Here's a pointer to Tony's paper for background info:
http://java.sun.com/developer/technicalArticles/javase/finalization/
This version also has limits on the number of dead Loggers that are
cleaned up per call; thanks to Alan Bateman for politely pushing me in
that direction.
The webrev is again relative to OpenJDK7, but the bug is escalated so
the fix will be backported to the JDK6-Update train. So again, I'll
need a minimum of two code reviewers.
Here is the URL for the webrev:
http://cr.openjdk.java.net/~dcubed/6942989-webrev/1/
Thanks, in advance, for any reviews.
Dan
More information about the jdk6-dev
mailing list