Welcome to Soft32 Linux Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

who's eating my RAM?

 
Goto page 1, 2
   Soft32 Home -> Linux -> Slackware RSS
Next:  [PATCH 0/5] tty_port_open  
Author Message
invalid

External


Since: Oct 06, 2009
Posts: 8



(Msg. 1) Posted: Tue Oct 06, 2009 1:20 pm
Post subject: who's eating my RAM?
Archived from groups: alt>os>linux>slackware (more info?)

I started using conky and I noticed something odd about my Slackware 13 64
bit system recently. I start out using about 95-100M of RAM. After I open
and close a few applications like Seamonkey, Firefox, email etc. and then
closing them all I am using 900M to over a gig. The memory doesn't seem to
be freed when I close these apps. My WM is Fluxbox.

If I reboot I go back to my happy 100M or less of RAM, I don't think any
services are suspect since they are all started before I get to my desktop.

How can I tell who is eating my RAM? I looked at top and nothing unusual is
running and ps ax doesn't show me any surprise tasks I didn't know about.

Thanks.
Back to top
Login to vote
Auric__

External


Since: Aug 01, 2007
Posts: 11



(Msg. 2) Posted: Tue Oct 06, 2009 1:20 pm
Post subject: Re: who's eating my RAM? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Tue, 06 Oct 2009 16:59:24 GMT, invalid.TakeThisOut@domain.invalid wrote:

> How can I tell who is eating my RAM?

I admit it, it's me. Sorry. Just got really hungry all of a sudden.

--
Another warning signal to the knowledgeable.
Back to top
Login to vote
Henrik Carlqvist

External


Since: Sep 09, 2005
Posts: 92



(Msg. 3) Posted: Tue Oct 06, 2009 1:20 pm
Post subject: Re: who's eating my RAM? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

invalid.RemoveThis@domain.invalid wrote:
> After I open and close a few applications like Seamonkey, Firefox, email
> etc. and then closing them all I am using 900M to over a gig.

> If I reboot I go back to my happy 100M or less of RAM,

Memory not in use is memory to no use...

If you check with free you will most likely find that your used memory is
being used to cache your harddisk. This is what free gives on my box:

$ free
total used free shared buffers cached
Mem: 1031712 1018736 12976 0 499092 111572
-/+ buffers/cache: 408072 623640
Swap: 498004 29024 468980

Above you can see the following:

I have 1031712 bytes of RAM (there is 1 GB in the machine)
Almost all, 1018736 bytes has come to some use
I still have 12976 bytes to no use
499092 + 111572 = 610664 bytes are used to speed up my harddisk.
Only 408072 bytes are used for programs
If no RAM would be used for buffers and cache I would have 623640 b free.
My swap space is 498004 bytes
I have used 29024 bytes of my swap.
I still have 468980 bytes left of my swap.

My swap has been used because I have had use for all of my RAM at some
occasion. Now some data is still swapped out, that data is probably never
used, otherwise it would be swapped in and some of the RAM now used to
cache my harddrive could host that data.

regards Henrik
--
The address in the header is only to prevent spam. My real address is:
hc3(at)poolhem.se Examples of addresses which go to spammers:
root@localhost postmaster@localhost
Back to top
Login to vote
Grant

External


Since: Nov 02, 2008
Posts: 81



(Msg. 4) Posted: Tue Oct 06, 2009 5:20 pm
Post subject: Re: who's eating my RAM? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Tue, 06 Oct 2009 16:59:24 +0000, invalid RemoveThis @domain.invalid wrote:

>I started using conky and I noticed something odd about my Slackware 13 64
>bit system recently. I start out using about 95-100M of RAM. After I open
>and close a few applications like Seamonkey, Firefox, email etc. and then
>closing them all I am using 900M to over a gig. The memory doesn't seem to
>be freed when I close these apps. My WM is Fluxbox.

Memory is in use or available for use. So think of that 'used' memory
as the high water mark, not as memory in current use Smile

Grant.
--
http://bugsplatter.id.au
Back to top
Login to vote
invalid

External


Since: Oct 06, 2009
Posts: 8



(Msg. 5) Posted: Thu Oct 08, 2009 9:20 am
Post subject: Re: who's eating my RAM? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2009-10-06, Henrik Carlqvist <Henrik.Carlqvist.RemoveThis@deadspam.com> wrote:

snip

Hi Henrik, here is my output of free after conky shows 1.11G in use:

total used free shared buffers cached
Mem: 4031084 3929536 101548 0 940 2776668
-/+ buffers/cache: 1151928 2879156
Swap: 4209008 0 4209008

I don't understand what free is saying. Is there some way to list memory
from each process and a total at the end?

I think after an app deallocates memory and terminates it should reduce the
amount of memory in use. I can't tell if this is a big storage leak or
normal.

Thank you.
Back to top
Login to vote
invalid

External


Since: Oct 06, 2009
Posts: 8



(Msg. 6) Posted: Thu Oct 08, 2009 9:20 am
Post subject: Re: who's eating my RAM? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2009-10-06, Grant <g_r_a_n_t_.RemoveThis@bugsplatter.id.au> wrote:

> Memory is in use or available for use. So think of that 'used' memory
> as the high water mark, not as memory in current use Smile

Hi Grant,

Your explanation makes sense but I would be happier if I knew all apps were
deallocating memory and no storage leak is happening. Do you know of some
way to see exactly what the storage is being used or not used for?

Thank you.
Back to top
Login to vote
Lew Pitcher

External


Since: Apr 30, 2007
Posts: 63



(Msg. 7) Posted: Thu Oct 08, 2009 9:20 am
Post subject: Re: who's eating my RAM? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On October 8, 2009 08:45, in alt.os.linux.slackware, invalid.RemoveThis@domain.invalid
(invalid@domain.invalid) wrote:

> On 2009-10-06, Henrik Carlqvist <Henrik.Carlqvist.RemoveThis@deadspam.com> wrote:
>
> snip
>
> Hi Henrik, here is my output of free after conky shows 1.11G in use:
>
> total used free shared buffers cached
> Mem: 4031084 3929536 101548 0 940 2776668
> -/+ buffers/cache: 1151928 2879156
> Swap: 4209008 0 4209008

OK, so lets look at these numbers

You have a total of 4,031,084K of memory available to userland programs.

Of this, 101,548K is entirely unused by anything.

Of the remaining 3,929,536K, the kernel has "borrowed" 2,776,668K to cache
frequently used user data. Note that the kernel will give this memory back
to user apps as they require it.

Of the remaining 1,152,868K, the kernel has "borrowed" an additional 940K to
buffer I/O streams with. Note that the kernel will give this memory back to
user apps as they require it.

So, out of your ~ 4G of userland memory, only 1,151,928K is actually in use
by userland programs.


--
Lew Pitcher

Master Codewright & JOAT-in-training | Registered Linux User #112576
http://pitcher.digitalfreehold.ca/ | GPG public key available by request
---------- Slackware - Because I know what I'm doing. ------
Back to top
Login to vote
invalid

External


Since: Oct 06, 2009
Posts: 8



(Msg. 8) Posted: Thu Oct 08, 2009 11:20 am
Post subject: Re: who's eating my RAM? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2009-10-08, Lew Pitcher <lpitcher.RemoveThis@teksavvy.com> wrote:
> On October 8, 2009 08:45, in alt.os.linux.slackware, invalid.RemoveThis@domain.invalid
> (invalid@domain.invalid) wrote:
>
>> On 2009-10-06, Henrik Carlqvist <Henrik.Carlqvist.RemoveThis@deadspam.com> wrote:
>>
>> snip
>>
>> Hi Henrik, here is my output of free after conky shows 1.11G in use:
>>
>> total used free shared buffers cached
>> Mem: 4031084 3929536 101548 0 940 2776668
>> -/+ buffers/cache: 1151928 2879156
>> Swap: 4209008 0 4209008
>
> OK, so lets look at these numbers
>
> You have a total of 4,031,084K of memory available to userland programs.
>
> Of this, 101,548K is entirely unused by anything.
>
> Of the remaining 3,929,536K, the kernel has "borrowed" 2,776,668K to cache
> frequently used user data. Note that the kernel will give this memory back
> to user apps as they require it.
>
> Of the remaining 1,152,868K, the kernel has "borrowed" an additional 940K to
> buffer I/O streams with. Note that the kernel will give this memory back to
> user apps as they require it.
>
> So, out of your ~ 4G of userland memory, only 1,151,928K is actually in use
> by userland programs.
>
>
Hi Lew,

Thanks for your explanation. But nothing is running, that's the problem. Why
should the numbers be so high with only fluxbox and startup services running
and nothing else? There must be a storage leak.
Back to top
Login to vote
Eef Hartman

External


Since: Jun 25, 2009
Posts: 21



(Msg. 9) Posted: Thu Oct 08, 2009 11:20 am
Post subject: Re: who's eating my RAM? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

invalid DeleteThis @domain.invalid wrote:
> Thanks for your explanation. But nothing is running, that's the problem. Why
> should the numbers be so high with only fluxbox and startup services running
> and nothing else? There must be a storage leak.

Use "top' in a terminal window (preferable a large one) and press M
while it's running. Then you'll get a list of the top memory using
programs. You'll often see that it is X itself that is using up a lot of
memory.
--
Eef Hartman, Delft University of Technology, dept. SSC/ICT
Back to top
Login to vote
invalid

External


Since: Oct 06, 2009
Posts: 8



(Msg. 10) Posted: Thu Oct 08, 2009 1:20 pm
Post subject: Re: who's eating my RAM? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2009-10-08, Eef Hartman <E.J.M.Hartman.TakeThisOut@tudelft.nl> wrote:
> Use "top' in a terminal window (preferable a large one) and press M
> while it's running. Then you'll get a list of the top memory using
> programs. You'll often see that it is X itself that is using up a lot of
> memory.

Now I'm down to 650M and X is taking 429 of it.....thanks I will try this
when the numbers go higher. Looks as if some of the memory does get
deallocated over time.
Back to top
Login to vote
Grant

External


Since: Nov 02, 2008
Posts: 81



(Msg. 11) Posted: Thu Oct 08, 2009 5:20 pm
Post subject: Re: who's eating my RAM? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Thu, 08 Oct 2009 12:46:29 +0000, invalid.TakeThisOut@domain.invalid wrote:

>On 2009-10-06, Grant <g_r_a_n_t_.TakeThisOut@bugsplatter.id.au> wrote:
>
>> Memory is in use or available for use. So think of that 'used' memory
>> as the high water mark, not as memory in current use Smile
>
>Hi Grant,
>
>Your explanation makes sense but I would be happier if I knew all apps were
>deallocating memory and no storage leak is happening. Do you know of some
>way to see exactly what the storage is being used or not used for?

To be honest it's not a problem I look at very often. There's a
server I wrote in perl a while back (holds ~150k records in memory,
talks via sockets) that I monitored for memory leakage and fixed up,
but that was last edited a year ago.

In general you'll notice a slowly increasing memory footprint for a
leaky app. -- but I forgot exactly how one might check that, try
looking at top, /proc/meminfo or /proc/$pid info.

Grant.
--
http://bugsplatter.id.au
Back to top
Login to vote
Aaron W. Hsu

External


Since: Aug 28, 2009
Posts: 22



(Msg. 12) Posted: Thu Oct 08, 2009 5:20 pm
Post subject: Re: who's eating my RAM? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Thu, 08 Oct 2009 13:04:35 -0400, <invalid.TakeThisOut@domain.invalid> wrote:

> Now I'm down to 650M and X is taking 429 of it.....thanks I will try this
> when the numbers go higher. Looks as if some of the memory does get
> deallocated over time.

The thing to remember is that not only does the kernel use memory when
nothing else is using it, but programs will also grab extra memory if no
one else is using it (depending on the program). These programs will
usually give up this memory when other applications need it.

Aaron W. Hsu

--
Of all tyrannies, a tyranny sincerely exercised for the good of its
victims may be the most oppressive. -- C. S. Lewis
Back to top
Login to vote
Henrik Carlqvist

External


Since: Sep 09, 2005
Posts: 92



(Msg. 13) Posted: Fri Oct 09, 2009 3:20 am
Post subject: Re: who's eating my RAM? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Grant <g_r_a_n_t_.RemoveThis@bugsplatter.id.au> wrote:
> In general you'll notice a slowly increasing memory footprint for a
> leaky app. -- but I forgot exactly how one might check that, try
> looking at top, /proc/meminfo or /proc/$pid info.

There are different tools to debug memory leaks in apps. One of my
favorites is valgrind.

All apps release leaked memory when killed. The exception is shared
memory used for interprocess commnication (sys v ipc). Such memory is
possible to find with ipcs and release with ipcrm. Fortunately not many
programs use sys v ipc.

regards Henrik
--
The address in the header is only to prevent spam. My real address is:
hc3(at)poolhem.se Examples of addresses which go to spammers:
root@localhost postmaster@localhost
Back to top
Login to vote
invalid

External


Since: Oct 06, 2009
Posts: 8



(Msg. 14) Posted: Fri Oct 09, 2009 5:20 am
Post subject: Re: who's eating my RAM? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2009-10-08, Aaron W. Hsu <arcfide.TakeThisOut@sacrideo.us> wrote:
> On Thu, 08 Oct 2009 13:04:35 -0400, <invalid.TakeThisOut@domain.invalid> wrote:
>
>> Now I'm down to 650M and X is taking 429 of it.....thanks I will try this
>> when the numbers go higher. Looks as if some of the memory does get
>> deallocated over time.
>
> The thing to remember is that not only does the kernel use memory when
> nothing else is using it, but programs will also grab extra memory if no
> one else is using it (depending on the program). These programs will
> usually give up this memory when other applications need it.
>
> Aaron W. Hsu
>
Thanks Aaron. That doesn't seem to explain what's happening now but it does
help to know anyway.
Back to top
Login to vote
invalid

External


Since: Oct 06, 2009
Posts: 8



(Msg. 15) Posted: Fri Oct 09, 2009 5:20 am
Post subject: Re: who's eating my RAM? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thank you.
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Assigning two NICs - I have a Slackware box with two NICs. With Slackware 10.2, device eth0 gets assigned to NIC #1 (a VIA Rhine built-in..

best way to setup bridge for qemu - I'd like to setup a bridge using the tun/tap driver on my slackware 12 system but still be able to use the..

Slackware 12.0: cannot view or print postscript files - Hi I just upgraded from Slack 11.0 to 12.0 following instructions from..

[gentoo-user] Eating RAM... - -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi! Since I changed my graphic card from ATI to NVIDIA I have a strange ...

[gentoo-user] kdeinit eating cpu. - I Googled a bit on this, and searched the forums some, and there seems to be quite a bit about kdeinit taking up a lot....

[gentoo-user] dosbox eating up resources - Hi folks, I've noticed, dosbox eats up very much resources, so for example takes very very long (maybe 10x ?). Is thi...
       Soft32 Home -> Linux -> Slackware All times are: Pacific Time (US & Canada) (change)
Goto page 1, 2
Page 1 of 2

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Categories:
 Windows
  Linux
 Mac
 PDA


[ Contact us | Terms of Service/Privacy Policy ]