Add setting to customise stack max

Add documentation for stack_max

a