Reputation: 303
I have a very important process running. I can not stop it and need to enlarge the java process' size! Is there any way to increase my java process' size online(at runtime)?
Upvotes: 6
Views: 3504
Reputation: 1052
The command line argument -Xmx sets the maximum Java heap size (mx). All java objects are created on the Java heap, but the total memory consumption of the JVM process consist of more things than just the Java heap. A few examples:
It is important to think of this when dimensioning how many processes that should run on a single server and what to set maximum heap size to. Usually the heap is by far the largest part of the process space, but the total size of the process will also depend on your application.
Reserved != Committed
It is easy to be alarmed by the number for reserved (or mapped) memory, but a process will not use any physical memory resources until it memory is committed.
So I would suggest you not to increase -Xmx size but to follow the solution provided by Peter Lawrey !!
Upvotes: 1
Reputation: 533492
You can increase the following during a running process.
But what you can't do is increase the maximum heap size. This is what a maximum means. More technically it is because the entire heap must be a single continuous region of memory and increasing the limit wouldn't help.
Upvotes: 6
Reputation: 1069
You can increase heap size but that configuration is depend on IDE. Eg : for eclipse edit eclipse.ini has
-Xms<size> - 2048m
-Xmx<size> - 2048m
depending on your RAM size.
Hope this helps.
Upvotes: -1