If you want to get real JVM arguments, this should help you. You can get all the JVM arguments using MXBean:
RuntimeMXBean RuntimemxBean = ManagementFactory.getRuntimeMXBean();
List<String> arguments = RuntimemxBean.getInputArguments();
You need to look for arguments starting with "-Xm (s | x)". The problem is that the value may be something like “256M”.