Adil Malik
Adil Malik

Reputation: 6357

Allow Java applications to use percentage of my RAM

Is it possible to allow Java applications to collectively use x% of my RAM?

Upvotes: 4

Views: 742

Answers (1)

Alex
Alex

Reputation: 4473

If you know your RAM when you run your Java program then simply use -xmx and define how much total memory to use. Xmx is start command parameter and can't be changed dynamically. So, if you want to change it on the fly then you have to calculate it and restart your program with new parameters. Here is good example.

Upvotes: 1

Related Questions