LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 09-23-2003, 10:12 AM   #1
mfeat
Member
 
Registered: Aug 2003
Location: Akron, OH
Distribution: Fedora Core 3
Posts: 185

Rep: Reputation: 30
The Case of the Missing Memory


On RedHat V9:

My 384M PC seems to be missing about 25 meg of RAM. I did an "init 1" to get into single user mode and, as you can see from the process listing at the bottom of this post, the sum of memory used by running processes isn't anywhere near what the command "free" shows for the amount used:

total used free shared buffers cached
Mem: 384584 98904 285680 0 1640 70052
-/+ buffers/cache: 27212 357372
Swap: 0 0 0

The running processes use less than 2M, yet the above shows 27M used (without the cache), so it seems like there is about 25M of memory missing. My first thought was that it's used by the OS, but according to /var/log/dmesg the OS memory is:

Memory: 382128k/393216k available (1347k kernel code, 8512k reserved, 999k data, 132k init, 0k highmem)

So it looks to me like the OS memory (about 11M) has already been deducted from the total shown by the "free" command (although there's a 2M discrepancy between the two numbers that I can't explain).

The reason for all of this is that I'm trying to run a program which used to work fine in Redhat V5.2 but since upgrading to V9 it won't run without excessive paging that kills the performance. The program is 364M and it was a tight fit on V5.2 but it ran with no paging at all (after initial startup). It wouldn't surprise me to find that I need to make a smaller V9 OS kernel, but how do I show how much space the kernel is taking (assuming it's more than what dmesg shows)? If it's not the OS then where's the other 25M of RAM?
--------------------------------------------------------------------------------------
Entire process list while in single user mode:

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 1384 116 ? S Aug31 0:04 init
root 2 0.0 0.0 0 0 ? SW Aug31 0:10 [keventd]
root 3 0.0 0.0 0 0 ? SW Aug31 0:00 [kapmd]
root 4 0.0 0.0 0 0 ? SWN Aug31 0:00 [ksoftirqd_CPU0]
root 9 0.0 0.0 0 0 ? SW Aug31 0:01 [bdflush]
root 5 0.0 0.0 0 0 ? SW Aug31 0:18 [kswapd]
root 6 0.0 0.0 0 0 ? SW Aug31 0:00 [kscand/DMA]
root 7 0.0 0.0 0 0 ? SW Aug31 25:53 [kscand/Normal]
root 8 0.0 0.0 0 0 ? SW Aug31 0:00 [kscand/HighMem]
root 10 0.0 0.0 0 0 ? SW Aug31 0:00 [kupdated]
root 11 0.0 0.0 0 0 ? SW Aug31 0:00 [mdrecoveryd]
root 15 0.0 0.0 0 0 ? SW Aug31 0:05 [kjournald]
root 113 0.0 0.0 0 0 ? SW Aug31 0:00 [khubd]
root 1221 0.0 0.0 0 0 ? SW Aug31 0:00 [kjournald]
root 1222 0.0 0.0 0 0 ? SW Aug31 0:07 [kjournald]
root 1223 0.0 0.0 0 0 ? SW Aug31 0:06 [kjournald]
root 20169 0.0 0.0 1384 64 tty1 S 16:43 0:00 init
root 20170 0.0 0.2 2216 892 tty1 S 16:43 0:00 /bin/sh
root 20446 0.0 0.1 2600 664 tty1 R 17:53 0:00 ps -aux
 
Old 09-24-2003, 11:16 AM   #2
mfeat
Member
 
Registered: Aug 2003
Location: Akron, OH
Distribution: Fedora Core 3
Posts: 185

Original Poster
Rep: Reputation: 30
Ok, apparently nobody wanted to look at this because the tables were munged by LQ's display, so now I've put them in fixed font and they're much more readable. Which by the way, is there an easier way of doing this? To make the tables readable I had to replace spaces with underlines and change the font to "fixed" since that's not one of the choices under the font button.

Here's the whole post again with more readable tables:

-------------------------------------------------------------------------------------------

On RedHat V9:

My 384M PC seems to be missing about 25 meg of RAM. I did an "init 1" to get into single user mode and, as you can see from the process listing at the bottom of this post, the sum of memory used by running processes isn't anywhere near what the command "free" shows for the amount used:

_____________total_______used_______free_____shared____buffers_____cached
Mem:________384584______98904_____285680__________0_______1640______70052
-/+_buffers/cache:______27212_____357372
Swap:____________0__________0__________0


The running processes use less than 2M, yet the above shows 27M used (without the cache), so it seems like there is about 25M of memory missing. My first thought was that it's used by the OS, but according to /var/log/dmesg the OS memory is:

Memory: 382128k/393216k available (1347k kernel code, 8512k reserved, 999k data, 132k init, 0k highmem)

So it looks to me like the OS memory (about 11M) has already been deducted from the total shown by the "free" command (although there's a 2M discrepancy between the two numbers that I can't explain).

The reason for all of this is that I'm trying to run a program which used to work fine in Redhat V5.2 but since upgrading to V9 it won't run without excessive paging that kills the performance. The program is 364M and it was a tight fit on V5.2 but it ran with no paging at all (after initial startup). It wouldn't surprise me to find that I need to make a smaller V9 OS kernel, but how do I show how much space the kernel is taking (assuming it's more than what dmesg shows)? If it's not the OS then where's the other 25M of RAM?
--------------------------------------------------------------------------------------
Entire process list while in single user mode:

USER_______PID_%CPU_%MEM___VSZ__RSS_TTY______STAT_START___TIME_COMMAND
root_________1__0.0__0.0__1384__116_?________S____Aug31___0:04_init
root_________2__0.0__0.0_____0____0_?________SW___Aug31___0:10_[keventd]
root_________3__0.0__0.0_____0____0_?________SW___Aug31___0:00_[kapmd]
root_________4__0.0__0.0_____0____0_?________SWN__Aug31___0:00_[ksoftirqd_CPU0]
root_________9__0.0__0.0_____0____0_?________SW___Aug31___0:01_[bdflush]
root_________5__0.0__0.0_____0____0_?________SW___Aug31___0:18_[kswapd]
root_________6__0.0__0.0_____0____0_?________SW___Aug31___0:00_[kscand/DMA]
root_________7__0.0__0.0_____0____0_?________SW___Aug31__25:53_[kscand/Normal]
root_________8__0.0__0.0_____0____0_?________SW___Aug31___0:00_[kscand/HighMem]
root________10__0.0__0.0_____0____0_?________SW___Aug31___0:00_[kupdated]
root________11__0.0__0.0_____0____0_?________SW___Aug31___0:00_[mdrecoveryd]
root________15__0.0__0.0_____0____0_?________SW___Aug31___0:05_[kjournald]
root_______113__0.0__0.0_____0____0_?________SW___Aug31___0:00_[khubd]
root______1221__0.0__0.0_____0____0_?________SW___Aug31___0:00_[kjournald]
root______1222__0.0__0.0_____0____0_?________SW___Aug31___0:07_[kjournald]
root______1223__0.0__0.0_____0____0_?________SW___Aug31___0:06_[kjournald]
root_____20169__0.0__0.0__1384___64_tty1_____S____16:43___0:00_init
root_____20170__0.0__0.2__2216__892_tty1_____S____16:43___0:00_/bin/sh
root_____20446__0.0__0.1__2600__664_tty1_____R____17:53___0:00_ps_-aux
 
Old 09-24-2003, 11:21 AM   #3
mfeat
Member
 
Registered: Aug 2003
Location: Akron, OH
Distribution: Fedora Core 3
Posts: 185

Original Poster
Rep: Reputation: 30
Ok, I see how to do a table now, with the LIst button (duh)
 
Old 09-24-2003, 12:04 PM   #4
Thetargos
Senior Member
 
Registered: Mar 2003
Location: Mexico City
Distribution: Fedora, Ubuntu & Mint
Posts: 1,679

Rep: Reputation: 45
I think you have those 25 Mb of RAM missing because the system is reserving those for the resident prgorams, remember Linux works with a protected memory scheme. This is the ouput of 'free' on my system:
Code:
             total       used       free     shared    buffers     cached
Mem:        514936     295564     219372          0      26360     135756
-/+ buffers/cache:     133448     381488
Swap:      1004020          0    1004020
[edit]
To preserve the output of a command look, use the code tags.
Code:
Code:


Last edited by Thetargos; 09-24-2003 at 12:05 PM.
 
Old 09-24-2003, 01:47 PM   #5
mfeat
Member
 
Registered: Aug 2003
Location: Akron, OH
Distribution: Fedora Core 3
Posts: 185

Original Poster
Rep: Reputation: 30
The code tags work better then what I was doing for displaying tables, thanks for the tip.

As to the 25M of memory, is there somewhere a person can look to see the amount of reserved spaced designated in a config file? I'm assuming by resident programs you're talking about the kernel. I'm also assuming that the amount of reserved space can be adjusted by changing parameters or rebuilding a new kernel. Correct me if any of these assumptions are wrong.

There's really 36M involved here because the total shown by "free" has already deducted 11M for the OS from the 384M total and then there's the other 25M that is shown as used even though there is nothing apparent that is using it (reserved space). So I guess my question really is, why the heck does the OS need all this space and how do I make it use less?
 
Old 09-24-2003, 05:56 PM   #6
Thetargos
Senior Member
 
Registered: Mar 2003
Location: Mexico City
Distribution: Fedora, Ubuntu & Mint
Posts: 1,679

Rep: Reputation: 45
The only thing I can come up with regarding these blocks of Memory is to ask you what services do you have running (I mean if you have any services running at all) to find out you my run the command:
Code:
# service --status-all
This will output how many (and which) services you have running, some of them may have reserved space, hence showing you that there's an extra 25M reserved by currently executing programs (and drivers for that matter; although the program may not be of that size currently, as reported by say top or ps)
 
Old 09-25-2003, 10:52 PM   #7
mfeat
Member
 
Registered: Aug 2003
Location: Akron, OH
Distribution: Fedora Core 3
Posts: 185

Original Poster
Rep: Reputation: 30
It's the hallmark of a truly dysfunctional OS when memory magically disappears & later re-appears. This is the type of thing I would expect from an ms-windows OS but not from Linux. But that is what happened after I re-booted the machine. The good news is that the memory freed up and I am now able to run the program, the bad news is that there is no explanation for what happened which means that it will probably happen again. At this point, I will re-direct my efforts toward searching for kernel patches that deal with memory leaks and hope for the best. Thanks to all who replied.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Missing memory in USB stick, flash memory, removable hd etc bamboo_spider Linux - Newbie 3 06-14-2006 05:39 PM
Why are all my upper case files being shown as lower case?? [Kernel 2.6.9-1.667 FC3] t3gah Fedora 4 03-11-2005 04:09 PM
Phyiscal memory missing.. b3nji Linux - Hardware 1 06-20-2004 07:29 PM
Missing memory MagDaddy Linux - Software 1 03-10-2004 01:26 AM
Memory missing from 'free' simonburton Linux - General 3 11-19-2003 08:24 AM


All times are GMT -5. The time now is 11:49 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration