I think the validation logic should check for the presence of -Xmx entry, and then it might throw an exception if user provided -Xmx, to make it more explicit. But, a lot of developers prefer the fail silently approach where if -Xmx is detected, ignore it from the jvmArgs that are passed, and LOG a message at WARN level.

Also, the validation logic should work for both UI and XML routes of providing configuration.