Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Working on Fedora Core 2, I'm suffering memory problems I can't understand
very well.
I only run a webserver (Apache) with several websites and DataBases (MySQL).
My machine has 508072 kbytes of RAM memory, and at this moment it's using 92.8%.
Why are there always 10 sub-daemons using 8.6% of the Memory each one? I run also a
Fedora Core 2 machine at home with Apache and several websites with several DBs and don't
suffer this issue...
The memory usage displayed by top includes the disk cache that the kernel maintains so it will always show memory as almost all used. To see what's actually used by programs compared to whats available (or 'free' for use by programs) run
Code:
free -m
and use the numbers on the '+/- buffers/cache' line.
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1980 mysql 16 0 72872 42m 6268 S 0.0 8.6 0:08.71 mysqld
1981 mysql 16 0 72872 42m 6268 S 0.0 8.6 0:10.18 mysqld
1982 mysql 20 0 72872 42m 6268 S 0.0 8.6 0:00.00 mysqld
1983 mysql 17 0 72872 42m 6268 S 0.0 8.6 0:00.00 mysqld
1984 mysql 16 0 72872 42m 6268 S 0.0 8.6 0:00.00 mysqld
1985 mysql 16 0 72872 42m 6268 S 0.0 8.6 0:00.00 mysqld
1986 mysql 16 0 72872 42m 6268 S 0.0 8.6 0:00.71 mysqld
1987 mysql 16 0 72872 42m 6268 S 0.0 8.6 0:00.50 mysqld
1988 mysql 16 0 72872 42m 6268 S 0.0 8.6 0:00.00 mysqld
1989 mysql 16 0 72872 42m 6268 S 0.0 8.6 0:00.69 mysqld
29647 mysql 16 0 72872 42m 6268 S 0.0 8.6 0:00.00 mysqld
30815 mysql 17 0 72872 42m 6268 S 0.0 8.6 0:00.00 mysqld
ps doesn't count memory shared between processes in the right way. Its not uncommon to have it add up to 500% or more of memory used which is obviously nonsense.
Hi tkedwards. Thank you very much for your ansewers.
I tried with 'free -m':
----------
total used free shared buffers cached
Mem: 496 492 3 0 40 81
-/+ buffers/cache: 370 125
Swap: 1058 4 1054
------------
I understand that I've got 125 Mbytes freee (25%), right?
The issue is that I noticed past week that MySQL daemon was stopped and I read
at '/var/log/messages':
Sep 30 12:17:13 myserver kernel: Out of Memory: Killed process 547 (mysqld).
Sep 30 12:27:25 myserver kernel: Out of Memory: Killed process 548 (mysqld).
Sep 30 12:31:30 myserver kernel: Out of Memory: Killed process 549 (mysqld).
Sep 30 12:31:42 myserver kernel: Out of Memory: Killed process 550 (mysqld).
Sep 30 12:32:38 myserver kernel: Out of Memory: Killed process 551 (mysqld).
Sep 30 12:33:29 myserver kernel: Out of Memory: Killed process 552 (mysqld).
Sep 30 12:35:14 myserver kernel: Out of Memory: Killed process 553 (mysqld).
Some minutes before:
Sep 30 12:10:49 www kernel: oom-killer: gfp_mask=0x1d2
Sep 30 12:11:06 www kernel: DMA per-cpu:
Sep 30 12:11:17 www kernel: cpu 0 hot: low 2, high 6, batch 1
Sep 30 12:11:22 www kernel: cpu 0 cold: low 0, high 2, batch 1
Sep 30 12:11:32 www kernel: Normal per-cpu:
Sep 30 12:11:44 www kernel: cpu 0 hot: low 32, high 96, batch 16
Sep 30 12:11:47 www kernel: cpu 0 cold: low 0, high 32, batch 16
Sep 30 12:12:22 www kernel: HighMem per-cpu: empty
I understand that I've got 125 Mbytes freee (25%), right?
Yeah.
Quote:
The issue is that I noticed past week that MySQL daemon was stopped and I read
at '/var/log/messages':
Sep 30 12:17:13 myserver kernel: Out of Memory: Killed process 547 (mysqld).
This could have been caused by a lot of things, it may not even be MySQL that's causing it but another process on the system. Besides an actual lack of memory it could be a bug, ulimits set too low, lack of swap space or something else even - google around for "Out of Memory: Killed process ". Also see this article, it explains it a bit: http://lwn.net/Articles/104179/ Generally this 'OOM Killer' thing only gets invoked as a last resort to avoid a kernel panic but you could try turning it off (as suggested in the LWN article) and see what happens.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.