Add option --max-memory

Add option --max-memory=X to specify the heap size in MB.
By default it is still 768 MB.
The tiniest program can run with --max-memory=2.

This pull request also includes the related addition of several properties about GC and memory consumption.