bitcoin/bitcoin — pull request #3609 by sipa (2014-01-31 13:17:33+00:00)
Title: Limit the number of orphan blocks in memory

In case the total number of orphan blocks in memory exceeds a limit (currently set to 750), a random orphan block (which is not depended on by another orphan block) is dropped. This means it will need to be downloaded again, but it won't consume memory until then.