Properly format Xmx option, and guard against invalid values.