0

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?

Amos
  • 237
  • 1
  • 4
  • 10

2 Answers2

0

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.

Anthony
  • 36
  • 3
  • That recommendation goes back to the days when RAM was measured in megabytes. These days I'll have 25% or even less swap on higher RAM machines. Memory is cheap, disk is slow, and time is the most expensive resource of all. – Michael Hampton Jun 16 '20 at 02:38
  • A couple GB of swap space is better than none, given a moderate amount of memory pressure. Moving pages around is easier when there is permanent storage. But that storage is slow, so waiting for lots of page ins is bad for performance. – John Mahowald Jun 16 '20 at 03:12
  • Yeah and with most servers coming with SSD now, swap is fairly quick. Not like the HDD days where you dreaded it if you started to page/swap. I still roll 1:1 up to a point for swap though, say 24GB of ram, then start to .5:1 or so. – Anthony Jun 17 '20 at 00:39
0

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?

Amos
  • 141
  • 6