Fail if configured memory is too large

If any memory size ends up being defaulted to a negative value,
fail with appropriate diagnostics.

[#49694617]
Merge 49694617-exit-if-memory-too-small to master

[Completes #49694617]