LinuxQuestions.org
Register a domain and help support LQ
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 02-11-2007, 02:02 PM   #1
GoingMad
LQ Newbie
 
Registered: Feb 2007
Distribution: Xebian
Posts: 8

Rep: Reputation: 0
Unhappy Free memory shrinking


Hi all,

I just finish a xbox 64MB running Xebian (kernel 2.6.14.3) as a samba server.
After a couple of hours it started to "complain" about "too many files open".
I made some research and found that increasing the file-max would solve my problem wich I did to 65536.
Now it stoped to do it but then it seems that something slowly is eating memory resources.
After booting top command shows:

top - 18:00:11 up 1 min, 1 user, load average: 0.63, 0.20, 0.07
Tasks: 69 total, 1 running, 68 sleeping, 0 stopped, 0 zombie
Cpu(s): 11.2% us, 9.6% sy, 0.0% ni, 62.6% id, 16.6% wa, 0.1% hi, 0.0% si
Mem: 57980k total, 52532k used, 5448k free, 2524k buffers
Swap: 257000k total, 0k used, 257000k free, 22052k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 root 16 0 1584 516 452 S 0.0 0.9 0:00.51 init
2 root 39 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/0
3 root 10 -5 0 0 0 S 0.0 0.0 0:02.48 events/0
4 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 khelper
5 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kthread
6 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kblockd/0
8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 pdflush
7 root 25 0 0 0 0 S 0.0 0.0 0:00.00 xbox_extsmi
9 root 15 0 0 0 0 S 0.0 0.0 0:00.00 pdflush
11 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 aio/0
10 root 25 0 0 0 0 S 0.0 0.0 0:00.00 kswapd0
12 root 15 -5 0 0 0 S 0.0 0.0 0:00.00 kseriod
13 root 15 0 0 0 0 S 0.0 0.0 0:00.00 kjournald
234 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 khubd
556 root 21 0 0 0 0 S 0.0 0.0 0:00.00 kjournald
755 daemon 20 0 1688 320 248 S 0.0 0.6 0:00.00 portmap
1146 root 16 0 1824 648 532 S 0.0 1.1 0:00.00 cron


An hour later I can see that the free memmory shrinking .
No files are being accessed and top is the only process i started.

Running ps -A i can see loads of lines like this:
... ? 00:00:00 nmbd

And it goes like this untill it crashes
Please,
Can anyone tell me what's happening? Is the value for file-max to big?
Sorry for the big post but i'm trying to give the much info I can...

Thanks
 
Old 02-11-2007, 03:18 PM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
In top, hit captal m ('M'), and it will sort by memory usage (if you post, post in a code block to keep formatting). Keep in mind that I/O buffers also use memory, but can be reclaimed when needed. The free command shows this:

Code:
$ free
             total       used       free     shared    buffers     cached
Mem:       1034368     842464     191904          0      23952     457780
-/+ buffers/cache:     360732     673636
Swap:      2032212      17420    2014792
The highlighted value is the free memory, after the I/O buffers have been accounted for. The value above it (191904 in this case) is what appears to be free if you don't take the buffers into consideration.

Last edited by macemoneta; 02-11-2007 at 03:20 PM.
 
Old 02-12-2007, 03:28 PM   #3
GoingMad
LQ Newbie
 
Registered: Feb 2007
Distribution: Xebian
Posts: 8

Original Poster
Rep: Reputation: 0
New value for swappiness?

Hi,

After a lot of research I think I solved the problem's adjusting the swappiness value.
Still have to find the best value though...
That makes the swap not be used. I just intend to have it as a NAS box anyway.
Any suggestions about the solution? Is there a better way to fix it?

Thanks

 
Old 02-12-2007, 03:38 PM   #4
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
Adjusting (reducing) swappiness does not reduce the memory footprint, it increases it. If you are no longer seeing a problem, then changing swappiness isn't what corrected the situation.
 
Old 02-12-2007, 06:02 PM   #5
GoingMad
LQ Newbie
 
Registered: Feb 2007
Distribution: Xebian
Posts: 8

Original Poster
Rep: Reputation: 0
Whatever...

Problem solved. Cached memory is being refreshed and swap is not used anymore.

Code:
top - 22:56:59 up  4:08,  1 user,  load average: 0.00, 0.00, 0.00
Tasks:  28 total,   2 running,  26 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.3% us,  0.0% sy,  0.0% ni, 99.3% id,  0.0% wa,  0.3% hi,  0.0% si
Mem:     57980k total,    56312k used,     1668k free,     3472k buffers
Swap:   257000k total,        0k used,   257000k free,    44204k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1431 root      16   0  8432 3648 2756 S  0.0  6.3   0:55.23 smbd
 1590 root      16   0 14680 1832 1444 R  0.0  3.2   0:00.44 sshd
 1593 root      15   0  2676 1452 1128 S  0.0  2.5   0:00.00 bash
 1212 root      16   0  5608 1384  916 S  0.0  2.4   0:00.00 nmbd
 1180 root      16   0  2280 1144  348 S  0.0  2.0   0:00.12 klogd
 1597 root      16   0  2136 1040  836 R  0.0  1.8   0:13.99 top
 1274 root      16   0  3544  904  660 S  0.0  1.6   0:00.00 sshd
 1312 root      16   0  2332  732  616 S  0.0  1.3   0:00.15 syslogd
 1163 root      16   0  2316  704  620 S  0.0  1.2   0:00.20 inetd
 1144 root      16   0  1820  644  532 S  0.0  1.1   0:00.00 cron
    1 root      16   0  1588  520  452 S  0.0  0.9   0:00.50 init
 1412 root      16   0  1584  492  424 S  0.0  0.8   0:00.00 getty
 1413 root      16   0  1580  488  424 S  0.0  0.8   0:00.00 getty
  753 daemon    19   0  1684  320  248 S  0.0  0.6   0:00.00 portmap
    2 root      39  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/0
    3 root      10  -5     0    0    0 S  0.0  0.0   0:02.48 events/0
    4 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 khelper
    5 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 kthread
    6 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 kblockd/0
    8 root      20   0     0    0    0 S  0.0  0.0   0:00.00 pdflush
    7 root      25   0     0    0    0 S  0.0  0.0   0:00.00 xbox_extsmi
    9 root      15   0     0    0    0 S  0.0  0.0   0:00.08 pdflush
   11 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 aio/0
   10 root      15   0     0    0    0 S  0.0  0.0   0:00.33 kswapd0
   12 root      15  -5     0    0    0 S  0.0  0.0   0:00.00 kseriod
   13 root      15   0     0    0    0 S  0.0  0.0   0:00.01 kjournald
  234 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 khubd
  556 root      15   0     0    0    0 S  0.0  0.0   0:00.06 kjournald
Thanks anyway

(By the way, no other change was made to the system...)

http://forums.gentoo.org/viewtopic.php?t=175419
 
Old 02-12-2007, 08:49 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,839

Rep: Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822
Did you reboot ???
 
Old 02-13-2007, 04:31 AM   #7
GoingMad
LQ Newbie
 
Registered: Feb 2007
Distribution: Xebian
Posts: 8

Original Poster
Rep: Reputation: 0
Hi,

I did reboot several times. As I mentioned the system was crashing (stop responding even to the keyboard) after a couple of hours after booting. All memory and swap was being used completely to the last byte. I know that unused RAM is a waste but I never expected that swap would be used completely too so no space would be left. In that case how would the system exchange RAM with the swap as both were full? It may seem illogical (or not) but the fact is that it stoped to crash every 2 or 3 hours.
I'm using a Xbox 64MB with 300 and 400MB HD.
Is there any explanation for it? It would be nice to know it as you can see I'm still a newbie...

Thanks all
 
Old 02-13-2007, 09:10 PM   #8
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 376Reputation: 376Reputation: 376Reputation: 376
so the problem persists then, right?? i'm asking cuz in post #5 you said it was solved...

in any case,
Quote:
Originally Posted by GoingMad
it seems that something slowly is eating memory resources.
this would be what a memory leak in one of your apps would feel like (not saying that is indeed the issue)... if you disable your smb/nmb daemons and reboot are you able to get relatively decent uptimes without any of the excessive memory usage?? if so, it might not be a bad idea to check whether you are using a properly patched version of said programs...

also, please let us know what kinda load this server is usually under, how many clients use it simultaneously, etc...

Last edited by win32sux; 02-13-2007 at 09:14 PM.
 
Old 02-18-2007, 06:30 PM   #9
GoingMad
LQ Newbie
 
Registered: Feb 2007
Distribution: Xebian
Posts: 8

Original Poster
Rep: Reputation: 0
Hi all,

The problem was solved as I mentioned.
Thanks for your reply win32sux.

GoingMad
 
Old 02-18-2007, 11:32 PM   #10
inspiron_Droid
Member
 
Registered: Dec 2006
Distribution: Debian (Wheeze)
Posts: 391

Rep: Reputation: Disabled
In looking at the out put of the ps command a noticed that you have samba running twice. Is this a mistake or did you intend to do so?

If the later is not true than my thinking is that you should be able to kil process ID # 1431 OR 1590 which in turn should reduce your memory load averages.

Last edited by inspiron_Droid; 02-18-2007 at 11:35 PM.
 
  


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
How to free up memory? arindom Linux - Newbie 4 12-29-2006 04:49 AM
LXer: Free software audience is shrinking. LXer Syndicated Linux News 1 12-15-2006 07:27 PM
Does free( ) immediatly free the memory? Rayven Programming 24 11-06-2006 03:24 AM
Free Memory according to vmstat Camino Linux - Newbie 3 02-27-2006 10:27 AM
How much memory is really 'free'? robbiemorgan Linux - Newbie 4 09-19-2004 08:05 PM


All times are GMT -5. The time now is 10:12 AM.

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