I am developing a Application using JavaFx 2.2.3 and jdk 1.7.0_09.This application will run on Windows, and Mac Osx. The problem is I am getting Out-Of-Memory. I know -Xms and -Xmx are used to tweak JVM memory. But requirement is we have to set JVM memory using java code as This is a desktop application so we can't tweak JVM on every system.
Now I find a solution for windows
proc = Runtime.getRuntime().exec("cmd.exe /c java -Xms250m -Xmx1024m -jar \"application.jar\" /n");
By using this code i can increase JVM memory before starting my Application jar. But this is a solution for Windows only.
Can any one tell similar kind of code For Mac.