Introduce dynamic maximal memory management

* Double the heap size when getting full.
* For doing so, we request a GC, double the asked max memory,
  and the GC will copy the heap to a twice bigger memory area.
* Ideally, we should compare after a normal GC if we are still
  above the threshold and regularly too, based on heap usage.