babuuz
babuuz

Reputation: 59

JAR program VM options?

I have a Swing app developed on Netbeans. In the properties, I have set the VM options to -Xmx128m -XX:MaxHeapFreeRatio=70 -XX:MinHeapFreeRatio=20.

And I compile it and compress it into Jar file. When I start the Jar file, do I have to set this VM options again in command prompt or does Jar file already contain these options from Netbeans?

Also, my program uses lots of computing and possibly fill up the heap space after a few hours, are the options written above able to clear the heap space? if not, any suggestions?

Upvotes: 1

Views: 321

Answers (1)

Andrew Thompson
Andrew Thompson

Reputation: 168825

..When I start the Jar file, do I have to set this VM options again in command prompt..

Yes. That way, we can choose the options at run-time to suit the user/use-case.

Also, my program uses lots of computing and possibly fill up the heap space after a few hours, are the options written above able to clear the heap space?

No. They are not 'magic'.

if not, any suggestions?

Fix the memory leak (if there actually is one).

Upvotes: 3

Related Questions