Please review this fix for a memory leak in the ProtectionDomain cache (which maps each ProtectionDomain to their granted PermissionCollection). The memory leak only occurs if custom permissions are used in a policy file.

http://cr.openjdk.java.net/~mullan/webrevs/8085903/webrev.00/

Custom permissions cause a chain of strong references that link back to the ProtectionDomain key used in the map, preventing it from being removed (and also preventing the custom permission's URLClassLoader from being garbage collected). This fix wraps the PermissionCollection in a SoftReference which allows the objects to be garbage collected in response to memory demand.

Thanks,
Sean

Reply via email to