0

I have a 22.04 server that keeps growing in RAM usage and then always ends up crashing and dying when RAM runs out. This happens a couple weeks apart, as you can see in the included graph of RAM usage. I cannot understand what is causing this, and as I understand it Ubuntu should be killing processes before the server crashes? Does anybody have any guidance on how to fix this problem? No process in htop is using alot of memory, so im not sure how to find out what the problem is. Its a VM, but I have several other ubuntu servers that run perfectly fine on the same host. Graph over RAM usage

  • 3
    Resembles a classic memory leak. If you can narrow the leaking process to specific software or service, then please file a bug against the leaky software. (Check first -- maybe it's already fixed in a newer release of that software). The temporary workaround is to reboot the VM more frequently. – user535733 Mar 08 '24 at 17:54
  • I would set up automatic reboots if your system is crashing. When your system is out of memory,it will either clear up other processes or simply seize up and not function. That's why RAM is so important. You may want to set up a reboot schedule to automatically reboot the system on a more frequent schedule since you seem to have a memory leak or such – Thomas Ward Mar 08 '24 at 17:55
  • Yeah Im also thinking its probably a memory leak or something, but is there a way to find out what process is causing it? Htop doesnt show any process using much RAM. Scheduling a reboot is a problem since it usually requires some manual intervention after reboot to work properly. I really need to find the source of the problem. – Björn Lindén Mar 08 '24 at 18:08
  • 2
    Especially if you have a moderate amount of swap space configured you can run something like for file in /proc/*/status; do awk '/VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; done | sort -k 2 -n -r|head -10 on a periodic basis to see what processes are actually swapping. I'd expect the proc with the memory leak will drift to the top of the list. – doneal24 Mar 08 '24 at 18:59
  • Swap is supposed to prevent this from happening. What's swappiness set to and what is the size of your swapfile? There was sort of a bug with Intel that caused something like this. – mchid Mar 09 '24 at 00:57
  • Although, I think that was only a problem on systems using i915 from intel. – mchid Mar 09 '24 at 01:03
  • Swappiness is at default 60. Got 8GB ram and 3GB swap. Havent touched swap settings or size in any way, just let the installer choose. – Björn Lindén Mar 09 '24 at 08:47

0 Answers0