apache/spark — pull request #3524 by ryan-williams (2014-12-01 04:43:38+00:00)
Title: fix spillable memory acquisition request

comment says we should request enough memory to potentially double our
memory-pool footprint, but the code was actually requesting more than
that:

currentMemory >= myMemoryThreshold (L66) implies
2*currentMemory - myMemoryThreshold >= currentMemory

(strict inequality in the former implies it in the latter, as well). We
were effectively trying to bump our memory footprint to:

3*currentMemory - myMemoryThreshold

I’m assuming that the comment reflects the true intent, not that it was
mistaken and we actually want (3*cM - mMT).