Limit gcThreshold to maximalHeapSize - tolerance

* Also pass explicitly activeMemory to computeGCThreshold(),
  so it is clearer and we need not to change config.activeMemory.
Fail clearly when we used too much memory