Compute memory limit for VM instead of hard code

Fixes #7