Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: top and redhat 6.2

  1. #1

    top and redhat 6.2

    RH 6.2 box. (no X configured on that box, this box is a dedicated Websense box)
    I'm troubled with memory statts on that box that show the following in top.
    Mem:
    257684K av
    237596K used
    20080K free
    16660K shared
    74748 buffered

    Two questions:
    1. what is 'shared' and what is 'buffered'
    2. I observe strange behaviour on that box - let's say during the day free memory is 50mb and it stays like that during the day, but the next morning I see that it went down to 40mb free. It stays 40mb during the day but the next morning I see that it's only 30mb free and so on.....
    Any reason for that or any known issues with 6.2?
    Could it be taht I run top all the time and top has some memory leaks?

  2. #2

    Re: top and redhat 6.2

    hello,
    1. i know buffered memory is stuff which has been cached in RAM. this is good, i am not sure what shared is.

    2. You always want 100 % of your memory used under linux - you paid good $$ for your memory and using it is good. things will get more and more cached (i.e. buffered) and programs will load faster.

  3. #3
    Moderator
    Good Guru
    Compunuts's Avatar
    Join Date
    May 2001
    Location
    California
    Posts
    3,935

    Re: top and redhat 6.2

    If the stuff from Operating System design is correct ( which I'm not sure since I"m still in the process of going through), then the shared memory is stuff that is used by more than one process.

    Since Linux is multiuser and multiprocessing OS, it will preserve anybody's work hoping that someone else will do the same. For example, some user will run TOP as a process but output will be preserved in case someone else in that system run TOP so that system don't need to actually do the query but just return TOP queries from the cached area of the memory and return it .....

  4. #4
    Moderator
    Good Guru
    Compunuts's Avatar
    Join Date
    May 2001
    Location
    California
    Posts
    3,935

    Re: top and redhat 6.2


    You always want 100 % of your memory used under linux - you paid good $$ for your memory and using it is good.
    Agree.. Although you will never see your RAM used up 100%, as close to that point as much is great. Why there will never be 100% RAM usage?? Good OSes, like Linux, will never allow system to go into "unsafe" mode with its resources.

    Having large FREE memory is a bad thing ( although not in all cases ), since you will just be wasting that resource.

  5. #5

    Re: top and redhat 6.2

    Folks, you got be a bit confused here....let's make it step by step. Take a look at this...(top output)

    257684K av - This is total amount recognized by OS,right?

    237596K used - This is how much is used for OS purposes, so you say this number should be close to 257684K ?

    20080K free - In this case what is the meaning of free memory, my understanding was that the more free memory you have the more is available for OS in case it is needed.....
    So I was thinking if my free memory goes from 50Mb to 10Mb then it is very bad.....

  6. #6

    Re: top and redhat 6.2

    everyting that is free and buffered isavailable for the OS and apps.

  7. #7

    Re: top and redhat 6.2

    So if 0K is free this is bad - it means some app consumed all available memory, right?

  8. #8
    Moderator
    Good Guru
    Compunuts's Avatar
    Join Date
    May 2001
    Location
    California
    Posts
    3,935

    Re: top and redhat 6.2


    237596K used - This is how much is used for OS purposes, so you say this number should be close to 257684K ?
    Not necessarily for the OS. It also includes the processes and data. So this is whatever data that is occupied in your physical memory.

    In this case what is the meaning of free memory
    The free memory means that you are wasting the space and the work load of the CPU.

    my understanding was that the more free memory you have the more is available for OS in case it is needed.....
    Generally, YES.

    That's how Windows do things ( or used to do ). Whenever you run the program, the program will execute and copy the program data to the memory space. The program will do whatever it needed to do. When it's done, it will free the memory ( by literally wiping out from the physical memory ) in which case, CPU needs to do the instuction of deleting it. So let's say that you accidently close the program by mistake and start a new process, Windows will copy from your HDD to memory again and work on it. Since the slowest part of your computer is the disk, it will get slower over time.

    What Linux does ( along with afew Unix varients ) is that when you execute processes, it will copy it to memory one time. Then it will run its processes. Even if you close and terminate your process, Linux will just close out your process but will keep the copy of the data in the RAM and just delete the pointers to it. VM manager will keep track of which are REAL processes and what are just buffered. When you re-run the program, it does not need to re-copy agian from the disk but just pick up from the copy of the memory. But when reporting from the OS, it got reported as used memory since it literaly is occupying the RAM. But OS also let you know that what amount is buffered so that it can be free at any time whenever the need for the memory arise ( such as new processes or new instructions ). The OS will let go of it unlike TSRs in Windows.
    So I was thinking if my free memory goes from 50Mb to 10Mb then it is very bad.....
    Generally, YES. But it all depends on OS to OS.

    <Clinton voice>
    Well, it just depends on what you mean by free...
    </Clinton voice>
    ;D

    Anyway, like I said above, you can count buffered, shared and free as one big FREE memories and can be taken back anytime. The OS just borrowed that shelf space for its house keeping and time saving functions. But your new processes are always priority to the OS.

  9. #9
    Moderator
    Good Guru
    Compunuts's Avatar
    Join Date
    May 2001
    Location
    California
    Posts
    3,935

    Re: top and redhat 6.2


    So if 0K is free this is bad - it means some app consumed all available memory, right?
    If it's 0K, it might means you have memory leak ..... Like I said before, you will never see 0K free since the OS maintain the function called "maintaining safe and unsafe modes". It will never allow itself to go to unsafe mode since it can create dead-locks and your computer will become unresponsive ( what it is called crashing ).

  10. #10
    Moderator
    Good Guru
    Compunuts's Avatar
    Join Date
    May 2001
    Location
    California
    Posts
    3,935

    Re: top and redhat 6.2

    Here is my TOP output for your comparison.
    Code:
    1:42pm up 48 days, 15:47, 3 users, load average: 1.09, 1.06, 1.01
    83 processes: 80 sleeping, 2 running, 1 zombie, 0 stopped
    CPU states: 0.9% user, 3.1% system, 95.8% nice, 0.0% idle
    Mem:  255120K av, 251476K used,  3644K free,  1684K shrd,  30528K buff
    Swap: 265032K av,  45308K used, 219724K free          36072K cached

Similar Threads

  1. redhat 9
    By pinehead in forum Linux - General Topics
    Replies: 7
    Last Post: 06-12-2003, 11:23 AM
  2. Redhat 9.0 is out
    By babbing in forum Redhat / Fedora
    Replies: 9
    Last Post: 04-03-2003, 03:02 PM
  3. new guy needs help with Redhat 8.0
    By bdmst16 in forum Linux - General Topics
    Replies: 15
    Last Post: 11-08-2002, 12:01 AM
  4. ip in redhat
    By pinehead in forum Linux - General Topics
    Replies: 2
    Last Post: 12-16-2001, 02:35 PM
  5. redhat and a 133
    By agar in forum Linux - General Topics
    Replies: 7
    Last Post: 12-08-2001, 02:49 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •