moved -Xmx to variable, fixed 'already running' check