Skip to content
Advertisement

Java heap size – will this work?

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?

JavaScript

Advertisement

Answer

Not going to work. The heap space is set from the -Xmx parameter at JVM initialization time. By the time you’re running Java code, it’s too late.

There could be an exception if the launch() method spawns a new JVM, but nothing I see indicates that that is the case.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement