Virtual Memory under top shows 10x higher on 2.6 kernel then on 2.4

Posted on 2006-05-08
Last Modified: 2013-12-16
Hi, I am comparing how an application runs on a 2.6 kernel (redhat EL4.3) to how it runs on a 2.4 kernel (redhat 7.3).  Using the ps command I see similar results in the SIZE column; however, using the top command I see a huge difference in the VIRT column.  The RES and SHR are about the same between 2.4 and 2.6, but the VIRT is 10 times higher in the 2.6 kernel (2.4 = 4800,  2.6= 41000).
I have the same top version (procps-3.2.3-8.3).  My guess is that teh VIRT in 2.4 is not working...?  I want to 100% sure that the application does not actually behave badly in 2.6... Thanks
Question by:medent
    LVL 14

    Expert Comment

    try using pmap to get "real" memory usage info.

    # pmap -d PID_OF_PROCESS
    Address   Kbytes Mode  Offset           Device    Mapping
    08048000     456 r-x-- 0000000000000000 068:00001 bash
    080ba000      12 rw--- 0000000000071000 068:00001 bash
    bfffa000      24 rw--- 00000000bfffa000 000:00000   [ stack ]
    ffffe000       4 ----- 0000000000000000 000:00000   [ anon ]
    mapped: 3096K    writeable/private: 612K    shared: 24K


    Author Comment

    Thanks. Here is the output.  Pmap looks the same on both (2.4 and 2.6), so top/VIRT on 2.4 is not accurate.  Can I derive from this output the real physical memory in use?

    [root@testvx root]# pmap -x 27977
    27977:   winmed_v15.26 -I194.0.0.250 -NPAULM-XP  -S5 -P11401 -R2 -TSun_May_07_09
    :23:55_2006434  -B15
    Address   Kbytes     RSS    Anon  Locked Mode   Mapping
    08048000   26824       -       -       - r-x--  winmed_v15.26
    09a7a000     512       -       -       - rw---  winmed_v15.26
    09afa000   11368       -       -       - rwx--    [ anon ]
    40007000      40       -       -       - r-x--
    40011000       4       -       -       - rw---
    40012000    1160       -       -       - r-x--
    40134000      24       -       -       - rw---
    4013a000       8       -       -       - rw---    [ anon ]
    4013c000      72       -       -       - r-x--
    4014e000       4       -       -       - rw---
    bffed000      76       -       -       - rwx--    [ stack ]
    -------- ------- ------- ------- -------
    total kB   40092       -       -       -
    LVL 14

    Accepted Solution

    "pmap -d" gives better info for your question
    it shows shared (used by several apps) and private (used only by your process) memory

    Author Comment

    perfect- thanks.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Currently, there is not an RPM package available under the RHEL/Fedora/CentOS distributions that gives you a quick and easy way to allow PHP to interface with Oracle. As a result, I have included a set of instructions on how to do this with minimal …
    If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now