linux is eating up my memory
2 Attachment(s)
Hi, I am unable to trace which process is consuming my memory.
In free -m command I can see 6 GB Used memory but in actual no such process is running to take that much memory. Even Top command shows used memory with out such process.Please help.... |
have you checked this: http://www.linuxatemyram.com/ ?
|
Quote:
|
Quote:
So it's not just the old caching of filesystem and data thing. If the "top" output is actually sorted by memory usage, there is nothing using the memory. Looks strange really. Is this a virtual machine? |
It looks to me like top is sorted by processor usage (the default). When you open top, press "M", and it will re-sort the list by memory usage.
|
Why do you think something is using up all your memory?
Based on your comments, I suspect you may have recently come to Linux from the Windows world. These two operating systems handle memory differently. When Windows doesn't have something specific to do with memory, it shows up as free. However, linux tries to use all the memory it has. If a process doesn't need it, the OS will use it for system level stuff - like buffers and cache - to speed up overall operation of the system. But if a process needs the memory, Linux will immediately free it up for that use. Windows displays excess memory as free, kind of like a badge of honor for its efficiency (ha!) Linux just goes about its way and uses that excess memory. In your case, you seem to have a goodly amount of memory, and even Linux can't find anything much to do with it. So you have about 5Gb showing as free. Having 6Gb in use does not represent "something using up your memory". Pretty much you're experiencing just the opposite ... you have more memory than Linux can figure out what to do with at this time. |
Quote:
buffers and cache is nearly nothing. It's all actually used. So he should really be interested what is using his memory. |
Try:
Code:
ps auxww --sort=-%mem Post the output of your system from the above command (put it inside [code] tags for readability). For example, here's the first few lines of output from my system: Code:
ps auxww --sort=-%mem | pg |
Quote:
However, with almost half of his systems memory showing as free, his system is running fine. It would be interesting to see what his biggest memory user processes are, but at this time, they are not negatively affecting his system. |
If you use top to show your memory usage, press shift-M to sort the processes according to memory usage. By default top sorts the display according to CPU time used. It is possible that very low CPU processes consume memory but are off-screen now.
In this case however I don't think you have a memory consumption problem. jlinkels |
Quote:
But ... that's a pretty unusual situation, that he is in. Almost nothing is cached or in the buffers? Still we have 6 GB used up? So the majority of data that he for example used during booting or during the work he might have done until that point is still in the use? That's unusual. I would call this a pathological state of the system. There may be a sensible explanation for it, but I haven't had it with all the system I'm running. What kind of processes would swallow 6 GB of memory and never give anything back so the kernel can cache it until it's reused? If I were to run this system, I would be _very_ curious about what's going on. |
Maybe he has some process, low in CPU usage so not showing up markedly in top, that still holds memory? Like a virtual machine running, but pretty much idle?
|
Might be the case.
But still he has only 69M in the cache? I had a quick look at my system after a simple boot (desktop of course, but may still be comparable). After boot I have 97M cached. If I start doing anything it immediately goes up, up to 315M in the first 2 minutes and after 15 minutes its at 500M. That's the data been used and not completely freed because it may be used again - of course you know this. Surprinsingly he has only 69M after 17 mins uptime. Strange! |
Yes, the cache does look a little strange.
Since the OP has not returned, ahem..., it would be interesting to know if they are running a custom kernel, have tweaked the kernel cache parameters, what is actually running on that machine, distro... We actually know almost nothing about it other than the screenshots. |
Thanks all for your helping hand...
I found some kernel entries which was making these values default. # added to set file max fs.file-max = 762368 # added to set vm.nr_hugepages = 3072 at boot time vm.nr_hugepages = 3072 # Added huge page group vm.huge_tlb_shm_group = 501 After commenting out these parameters & reloading the parameters Memory usage show normal... [pts/9][19:16:42:root@XXXXXXXX] ~>free -m total used free shared buffers cached Mem: 11913 4700 7212 0 2 131 -/+ buffers/cache: 4566 7346 Swap: 6023 0 6023 Extremely sorry for the delayed reply. Thanks you all again... |
All times are GMT -5. The time now is 09:29 AM. |