Add heap ratio options. Stop using MarkableInputStream. Slow.

Change-Id: I052d75c9e65b1f715a6a30e840439ebea48c6789