VPS: Operating system: Ubuntu Guaranteed RAM: 10g Burst or Dynamic RAM: 20g
When exactly a VPS ( Virtual Private Server) kills the process when dedicated memory limit exceeds? And which process gets killed and on what basis processes are filtered for killing ???
To make my question even more precise, I have certain scenarios. It would be helpful if you could tell me my understanding is right.
I can see privvmpages is set to around 20g and vmguard set to 10g. So that means, I can confirm 10g guaranteed and 20g burst memory is available.
Now let's take this scenario where out of 10g dedicated ram, 8g is occupied by some processes and I am going to allocate 3g to java jvm. In this case, 2g is allocated from dedicated ram and 1 g from burst ram ???. If so, in tight memory situation, container choose which process to kill?? In my understanding, since 1g allocated from burst ram, java jvm process gets killed ???
Processes that are allocated memory from dedicated ram always safe and never gets killed??? Its the process that occupies burst ram gets killed always??? Because when I allocate memory to java, though I choose xms and xmx to set initial and maximum memory, actual consumption happens when memory is needed. So if memory is allocated from dedicated ram, is jvm safe from being killed???
How can I make sure that I am allocating memory from dedicated ram???
When enough memory is available in dedicated ram, allocation always happens from dedicated ram???
If my above understanding is wrong and doesn't make sense, could you explain under what circumstances and which process are eligible to get killed under tight memory situations???
The reason why I am raising this question is, I can see its always the jvm getting killed when memory exceeds around 15g. Its always always the jvm. When I set initial and max memory, allocation is always successful. But when it really starts consuming memory, its this process that always getting killed.. and not touching other process... So I want to make jvm process safe and stop from being killed all the time.
If I change the memory allocation order, ie jvm memory first and rest of the allocation, will it work??? Or do i have to set priority for process???