try/finally all the getResource/returnResource calls, throw exception when there is nothing in the remaining buffer
use 10k buffers