LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-09-2014, 01:45 AM   #1
subratkprusty
LQ Newbie
 
Registered: Aug 2013
Posts: 7

Rep: Reputation: Disabled
linux is eating up my memory


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....
Attached Thumbnails
Click image for larger version

Name:	Capture.JPG
Views:	30
Size:	20.4 KB
ID:	16606   Click image for larger version

Name:	Capture1.JPG
Views:	41
Size:	127.6 KB
ID:	16607  
 
Old 10-09-2014, 02:11 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,121

Rep: Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270
have you checked this: http://www.linuxatemyram.com/ ?
 
3 members found this post helpful.
Old 10-09-2014, 02:17 AM   #3
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Quote:
Originally Posted by pan64 View Post
have you checked this: http://www.linuxatemyram.com/ ?
Great info if I read it right
 
Old 10-09-2014, 10:15 AM   #4
grover
LQ Newbie
 
Registered: Mar 2011
Location: Germany
Distribution: Mageia, Mandriva, CentOS
Posts: 20

Rep: Reputation: 2
Quote:
Originally Posted by pan64 View Post
have you checked this: http://www.linuxatemyram.com/ ?
The "free" output shows that his memory is actually used.
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?
 
2 members found this post helpful.
Old 10-09-2014, 11:07 AM   #5
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
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.
 
1 members found this post helpful.
Old 10-09-2014, 11:35 AM   #6
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,116

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
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.
 
Old 10-09-2014, 12:12 PM   #7
grover
LQ Newbie
 
Registered: Mar 2011
Location: Germany
Distribution: Mageia, Mandriva, CentOS
Posts: 20

Rep: Reputation: 2
Quote:
Originally Posted by haertig View Post
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.
Yes, that's usually the case. But have a look at the "free" output supplied.
buffers and cache is nearly nothing. It's all actually used.
So he should really be interested what is using his memory.
 
Old 10-09-2014, 01:06 PM   #8
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,116

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
Try:
Code:
ps auxww --sort=-%mem
The above will put the biggest users at the top of the output. You will have to scroll back up to see them or send your output to pg, more, or head, etc.

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
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
user1    11218  9.4 10.9 1180784 387412 ?      Sl   09:15  10:26 /usr/lib/firefox/firefox
root      1434 34.0  4.3 272808 154580 tty8    Ss+  Sep18 10313:46 /usr/bin/X :0 -audit 0 -auth /var/lib/mdm/:0.Xauth -nolisten tcp vt8
plex     24082  0.2  1.5 1806932 55692 ?       SNl  Oct08   2:33 Plex Plug-in [com.plexapp.system] /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 0.9.9.14.531-7eef8c6 /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/System.bundle
user1     1792  0.0  0.9 283748 33680 ?        S    Sep18   0:09 /usr/lib/xfce4-places-plugin/xfce4/panel-plugins/xfce4-places-plugin  2 12582965 places Places Access folders, documents, and removable media 
plex     27333  0.0  0.9 1951508 33656 ?       S<l  Sep19   8:16 ./Plex Media Server
user1     6066  0.0  0.8 617940 30912 ?        Sl   Sep29   0:02 /usr/bin/python /usr/share/system-config-printer/scp-dbus-service.py
root      3860  0.0  0.8 516516 30248 ?        Sl   Sep22   1:09 python /usr/lib/linuxmint/mintUpdate/mintUpdate.py show
...
 
1 members found this post helpful.
Old 10-09-2014, 01:11 PM   #9
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,116

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
Quote:
Originally Posted by grover View Post
Yes, that's usually the case. But have a look at the "free" output supplied.
buffers and cache is nearly nothing. It's all actually used.
So he should really be interested what is using his memory.
Point taken. I made a generic statement and should have looked at the specifics of his free output. My error.

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.
 
Old 10-09-2014, 02:19 PM   #10
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,493

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
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
 
Old 10-09-2014, 02:56 PM   #11
grover
LQ Newbie
 
Registered: Mar 2011
Location: Germany
Distribution: Mageia, Mandriva, CentOS
Posts: 20

Rep: Reputation: 2
Quote:
Originally Posted by haertig View Post
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.
Well, yes and no. I think as this user has got 5 GB of free memory, he doesn't have a problem of running out of memory.
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.
 
Old 10-09-2014, 02:59 PM   #12
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,116

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
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?
 
Old 10-09-2014, 03:23 PM   #13
grover
LQ Newbie
 
Registered: Mar 2011
Location: Germany
Distribution: Mageia, Mandriva, CentOS
Posts: 20

Rep: Reputation: 2
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!
 
Old 10-09-2014, 03:35 PM   #14
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 3,880
Blog Entries: 1

Rep: Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998
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.
 
Old 10-13-2014, 09:48 AM   #15
subratkprusty
LQ Newbie
 
Registered: Aug 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
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...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux is eating up memory subratkprusty Linux - Server 1 10-09-2014 02:12 AM
HELP ... Linux is eating my memory!!! don_dimo Linux - General 4 10-22-2003 12:23 AM
Linux is eating to much memory!!! alwin Linux - General 9 01-13-2003 05:50 PM
Linux is eating to much memory!!! alwin Linux - Software 2 01-12-2003 11:33 PM
Linux is eating to much memory!!! alwin Linux - Networking 2 01-12-2003 11:32 PM


All times are GMT -5. The time now is 03:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration