Java heap size - will this work?

Posted by UnCon on Stack Overflow See other posts from Stack Overflow or by UnCon
Published on 2010-04-03T21:25:03Z Indexed on 2010/04/03 21:33 UTC
Read the original article Hit count: 252

Filed under:
|

Hi, I try this with NetBeans desktop application template - increasing heapsize (to 512 MiB) of executed .jar file. (I believe that NetBeans uses Singleton app by default - SingleFrameView) Will it work?

    public static void main(String[] args) {
        if (args == null) {
            args = new String[1];
            args[0] = "Xmx512m";
        } else {
            String[] tempArgs = new String[args.length+1];
            for (int i=0; i<args.length; i++) {
            tempArgs[i] = args[i];
            }
            tempArgs[tempArgs.length-1] = "Xmx512m";
            args = tempArgs;
        }
        launch(MyApp.class, args);
    }
}

© Stack Overflow or respective owner

Related posts about java

Related posts about heap