Cope with $MEMORY_LIMIT not being set

The warning code failed if $MEMORY_LIMIT is not set. Add a guard to
allow it to cope.

[#52692569]