Score:0

Ubuntu 20.04 High RAM usage

ml flag

I have a Linux VM that has 8 GB RAM. This is a screenshot of htop which includes all system information (tasks,services). There's no application using too much RAM when looking at the PIDs, but the total RAM usage is 6.26 GB. Why is the virtualized part of these tasks too high? e.g: mssql-server (5711 M VIRT , 511M RES) I already have configured mssql server while setting max.memorylimitmb to 3072 MB, but still my server is using too much RAM.

htop


I have added screenshot when typed top o %MEM -n1

top p %MEM -n1

inxi -t m20

free -m

Normal values after reboot , When I restarted server , everything is fine total ram consuming 1.34 GB , but after 10-15 hours automatically ram using increases to 6 GB as you can see pictures I shared before..

inxi -t m20 after reboot

inxi -t m20 | grep apache2 after reboot

pl flag
Can you please paste the text output (rather than a screenshot) of `top o %MEM -n1`. It's way easier to read than this.
Terrance avatar
id flag
Every 2 of those 0.5% listed is 1% of your memory being used and those do add up. Your screen cut off is too short to see how many of those are there. Please [edit](https://askubuntu.com/posts/1454919/edit) your question and also add the output of `inxi -t m20` which will list the top 20 memory using applications. I suspect that your web server (Apache / www-data) that you are running is using up most of your memory.
Onur İn avatar
ml flag
I have added screenshot for inxi -t m20 , Used/Total : 6723,9/7976,1 MB , There's no task consuming too much Ram, where's the problem ? Why my used ram is so high? What's my fault?
ru flag
MS SQL Server will consume all the RAM it can, and you are running SQLServer as evidenced by your command. Additionally, Apache2 is not memory-light either and running multiple SQL systems (mysql, SQL Server, etc.) and also dotnet applications at the same time is likely to eat your memory
Onur İn avatar
ml flag
@ThomasWard Dear Thomas , All of services running on server consuming 1.5 GB ram as you can see in screenshots I shared my question.But why free memory value too low? Sql server - 765 MB ram Mysql - 162 MB ram .Net service 130 MB ram But totally used ram value is 6.5 GB , where're the other apps using my ram ?
ru flag
@Onurİn what's the output of `free -m`? Chances are it's being held by your *cache* and *buffers* and it's able to be given to things that need it regularly. https://www.linuxatemyram.com/ explains that well.
Onur İn avatar
ml flag
@ThomasWard I have added output you asked , available ram value is only 1340 MB
Onur İn avatar
ml flag
I also tried swapoff -a and swapon -a but nothing changed..
ru flag
@Onurİn `swapoff` won't help you here. You literally have no memory available, it's likely being eaten by other processes, SQL Server, Apache, and MySQL are examples. Note that on average, MS SQL Server will eat up to 4GB just by idling and that's why it requires a minimum of 4GB to function. I'm guessing that MSSQL is likely one of your cuplrits here. If you need all this SQL and web interface functionality, you need to upgrade the RAM on your machine entirely.
Onur İn avatar
ml flag
@ThomasWard Now I stopped mssql-server by typing systemctl stop mssql-server , but free ram value increased 1 GB . Now totally used ram 5.55 GB ram.
Onur İn avatar
ml flag
I couldn't find the other apps using my ram .
Onur İn avatar
ml flag
Anybody can help?
Terrance avatar
id flag
Honestly, I think it is Apache2 using up your memory. Minimum requirements are at least 4GB of RAM. http://docs.cloudstack.apache.org/en/latest/installguide/overview/_requirements.html You can still use `inxi` to see all of yours. On your top command that you posted shows 160 tasks, so to show them all use `inxi -t m160` and to view all of one specific app, like Apache2, you can use `inxi -t m160 | grep -i apache` to list only Apache stuff. I only say this because in your screenshots you keep adding we are only seeing partial stuff.
Terrance avatar
id flag
I also recommend you see: https://askubuntu.com/questions/53264/how-do-you-find-out-which-program-is-using-too-much-memory One other thing, I do work around servers everyday, and 8GB is a very low amount to ever have in a server that is serving multiple things.
Onur İn avatar
ml flag
@Terrance Dear Terrance , when I restarted server everything is fine total ram used is 1.34 GB , after 10-15 hours this problem occurs suddenly , total ram increases to 6 GB . All application and services are same. Is this caching mechanism or different something? Also I added a picture indicates ram value used by apache2.Apache2 only using 300-400 mb ram totally. I don't know what should I do , I'm confused..
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.