RFR: 8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection

Sean Mullan sean.mullan at oracle.com
Fri May 15 17:01:31 UTC 2015

This is the first in a series of fixes that I will be sending out for 
review for JEP 232 (Improve Secure Application Performance) [1].

webrev: http://cr.openjdk.java.net/~mullan/webrevs/8055753/webrev.00/
bug: https://bugs.openjdk.java.net/browse/JDK-8055753

This fix changes the ProtectionDomain (PD) cache from a synchronized 
HashMap to a ConcurrentHashMap. This increases the throughput of the 
Policy.implies method up to ~3x (when the PD is cached) as more threads 
are added. The bug contains a performance chart with more details.

Since the previous code used a WeakHashMap, and there is no equivalent 
WeakConcurrentHashMap, I have added some additional code to check for 
and remove weak keys from the ConcurrentHashMap.

Finally, I had to undo the fix for JDK-8078989 [2] in this fix. That fix 
has some problems and is likely the cause of another regression we have 
seen [3]. I am still investigating that, but I will likely re-open that 
bug before I push this fix back.


[1] http://openjdk.java.net/jeps/232
[2] https://bugs.openjdk.java.net/browse/JDK-8078989
[3] https://bugs.openjdk.java.net/browse/JDK-8077418

More information about the security-dev mailing list