RFR: 8304818: Prune HttpURLConnection cache when corresponding Authenticator is garbage collected
Michael McMahon
michaelm at openjdk.org
Thu Mar 23 15:55:03 UTC 2023
Hi,
Can I get a review for this please? This change uses a Cleaner to check when java.net.Authenticator instances become unreachable, and then prunes the authentication cache for entries that correspond to that Authenticator and therefore cannot be used again. This stops the authentication cache from growing in size unbounded. Note, this only happens in the probably unusual case where more than one Authenticator object is used. Normally there is no reason to use more than one instance.
Thanks,
Michael.
-------------
Commit messages:
- revert removed methods (used in tests)
- initial impl
Changes: https://git.openjdk.org/jdk/pull/13159/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=13159&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8304818
Stats: 242 lines in 4 files changed: 239 ins; 0 del; 3 mod
Patch: https://git.openjdk.org/jdk/pull/13159.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/13159/head:pull/13159
PR: https://git.openjdk.org/jdk/pull/13159
More information about the net-dev
mailing list