Bug 571531 - Cap evaluation cache at 10000
Because permission instances can be infinite the evaluationCache can
grow unbounded leading to a memory leak. This is a quick fix to cap the
cache at 10000. A better approach may be to use some weak reference
cache in the future, but for now we need to stop the uncontrolled leak.
A test is added that does 10 million different file permission checks.
On my system this grinds to a halt after about 8 million checks. With
the cap at 10000 the 10 million permission checks happen <15 seconds.
Change-Id: I6e18d4d6fcab274bb2f56c69a6e0893f8e474418
Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
2 files changed