Validate GC limits and adapt threshold

* Setting 'gc.max' is applied immediately, which
  starts a GC if heap usage is close to the new maxGCThreshold.