neo4j/neo4j — pull request #3619 by chrisvest (2014-12-06 01:08:42+00:00)
Title: Make the page cache eviction thread immune to OutOfMemoryErrors

These changes are fairly subtle, but they should allow the eviction thread so survive all possible OutOfMemoryErrors. OOMEs can be thrown from every spot where we, or anyone really, allocate an object. And they can also be thrown from UnsafeUtil.malloc.

These changes have been made by carefully analysing the code line by line. There are no tests ensuring that the property of OOME resilience is upheld in the future, so we have to be careful with our maintenance. The reason for the lack of testing is simply that I couldn't think of any way to test this in any way that is even remotely comprehensible.

I recommend a well-aged Islay whisky, a stress-free environment and plenty of time, when reviewing these changes.