I have an Ubuntu 18.04 which mostly runs tomcat. The memory consumption is between 800mb-1gb and I have 2gb total. The swap is 512mb and the used swap is 480mb.
I set clamav to run at 3am and it consumes around 800mb when it runs.
It looks as if clamav was out of the picture, the server with 2gb will hold, except for that 480mb used swap. Can that be a problem or because I have 1gb free, it is still not something to worry about?
Maybe I am not tracking the question exactly, but you should be fine. As long as you don't get a surplus in RAM requests.
On a side note, I am surprised you only have 512mb swap, I would have thought 1:1 in terms of RAM and SWAP on a VM.
I can't comment (<50 reputation):
You wrote "As long as you don't get a surplus in RAM requests": I have clamav at 3am, that requires 800mb. Is that considered as surplus in RAM requests? I set tomcat to stay alive no matter what.
I understand the logic behind the swap is almost full while the RAM is half empty and still I wonder why in such case, the logic doesn't change.
And one last question if I may: if the memory consumption goes too high, processes are getting killed. If the swap reaches full capacity, what happens then?