<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Can we use the top command to found out free mem in the HP-UX system? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/can-we-use-the-top-command-to-found-out-free-mem-in-the-hp-ux/m-p/5113689#M446485</link>
    <description>Vinoyee,&lt;BR /&gt;&lt;BR /&gt;What I think is happening here, is that you are misunderstanding the output for swapinfo -tam,&lt;BR /&gt;the swapinfo output never talks about memory on the system, it only talks about swap, and the memory line only indicates how much pseudo-swap has been reserved, it does not refer in any moment about physical memory.&lt;BR /&gt;&lt;BR /&gt;I think this document will really help on your quest:&lt;BR /&gt;&lt;BR /&gt;ftp://eh:spear9@hprc.external.hp.com/memory.htm&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Jaime.</description>
    <pubDate>Thu, 12 Jun 2008 11:24:30 GMT</pubDate>
    <dc:creator>Jaime Bolanos Rojas.</dc:creator>
    <dc:date>2008-06-12T11:24:30Z</dc:date>
    <item>
      <title>Can we use the top command to found out free mem in the HP-UX system?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/can-we-use-the-top-command-to-found-out-free-mem-in-the-hp-ux/m-p/5113688#M446484</link>
      <description>Many times in our carrier we all might have tried to find out the available free memory in the system. Especially, while troubleshooting performance issue. Always the swapinfo, glance and top command outputs will not match and the swapinfo command always says there is sufficient free memory available and enjoy the life! In the same time “top” will be weeping “Available free memory is very less”!!!&lt;BR /&gt;&lt;BR /&gt;Hence, I have spent some time and did some analysis. I have compared the output for swapinfo, glance, top, crashinfo and the system performance memory tab output of sam utility.&lt;BR /&gt;&lt;BR /&gt;With my studies I concluded the following.&lt;BR /&gt;1. The free memory statement in the top command output is approximately nearer to the actual free memory and we can consider this output to find out the available free memory in the system.&lt;BR /&gt;2. In fully loaded system, in the top command output, real memory +virtual memory+ free memory will be equal to the physical memory size.&lt;BR /&gt; Here, the virtual memory is not representing the swap space.  The free memory statement in top, sam, glance and crashinfo command outputs are more or less have the same figure.&lt;BR /&gt;3. When swapinfo computes the free memory it doesn’t consider the memory allotted for bufpages etc. Hence, it will report available free mem always higher than the actual free mem. The theory says that the physical memory reported in swapinfo is around 70% of the installed memory. However, on all latest systems swapinfo is reporting the actual installed memory.&lt;BR /&gt;&lt;BR /&gt;Conclusion: top is the use full tool to find out the free memory. &lt;BR /&gt;&lt;BR /&gt;Open to comments and additional information on this thread.&lt;BR /&gt;&lt;BR /&gt;# model&lt;BR /&gt;9000/800/rp3440&lt;BR /&gt;Os: HP-UX 11.23&lt;BR /&gt;&lt;BR /&gt;SAM:&lt;BR /&gt;&lt;BR /&gt;Physical Memory:         18446.5 MB   ==18GB                          &lt;BR /&gt; Real Memory:                                                     &lt;BR /&gt;  Active:                6140673.5 KB    ===&amp;gt; 6GB                       &lt;BR /&gt;  Total:                  6183557.0 KB                            &lt;BR /&gt;  Virtual Memory:                                                   &lt;BR /&gt;  Active:                10587553.1 KB   ==&amp;gt; 10GB                        &lt;BR /&gt;  Total:                 10696530.1 KB                           &lt;BR /&gt;  Free Memory Pages:       31604 at 4 KB/page  ==&amp;gt;   129MB            &lt;BR /&gt;  Swap Space:                                                       &lt;BR /&gt;   Avail:                 16384 MB                                 &lt;BR /&gt;   Used:                  8934 MB    &lt;BR /&gt;&lt;BR /&gt;TOP output :&lt;BR /&gt;Memory: 6180956K (6133952K) real, 10 688 884K (10564680K) virtual, 126308K free  &lt;BR /&gt;Real: 6GB&lt;BR /&gt;Virtual: 10GB&lt;BR /&gt;Free:126MB&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Crashinfo output:&lt;BR /&gt;                       ==================&lt;BR /&gt;                        = Memory Globals =&lt;BR /&gt;                        ==================&lt;BR /&gt;&lt;BR /&gt;Physical Memory     = 4718080 pages (18.00 GB)&lt;BR /&gt;Free Memory         = 33890 pages (132.38 MB)&lt;BR /&gt;Average Free Memory = 35833 pages (139.97 MB)&lt;BR /&gt;gpgslim             = 17408 pages (68.00 MB)&lt;BR /&gt;lotsfree            = 73728 pages (288.00 MB)&lt;BR /&gt;desfree             = 17408 pages (68.00 MB)&lt;BR /&gt;minfree             = 8448 pages (33.00 MB)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;dbc_max_pct           = 50 %&lt;BR /&gt;dbc_min_pct           = 5 %&lt;BR /&gt;dbc current pct       = 43.8 %&lt;BR /&gt;bufpages              = 2068766 pages (7.89 GB)&lt;BR /&gt;Number of buf headers = 1871625 = (1.7 MB&lt;BR /&gt;&lt;BR /&gt;fixed_cache_size = 0&lt;BR /&gt;dbc_parolemem    = 0&lt;BR /&gt;dbc_stealavg     = 356990     (0.34MB  &lt;BR /&gt;dbc_ceiling      = 2359040 pages (9.00 GB)&lt;BR /&gt;dbc_nbuf         = 117952       (0.11MB&lt;BR /&gt;dbc_bufpages     = 235904 pages (921.50 MB)&lt;BR /&gt;dbc_vhandcredit  = 2776543  (2.65MB)&lt;BR /&gt;orignbuf         = 0&lt;BR /&gt;origbufpages     = 0 pages&lt;BR /&gt;&lt;BR /&gt;# swapinfo -tam&lt;BR /&gt;             Mb      Mb      Mb   PCT  START/      Mb&lt;BR /&gt;TYPE      AVAIL    USED    FREE  USED   LIMIT RESERVE  PRI  NAME&lt;BR /&gt;dev       16384      27   16357    0%       0       -    1  /dev/vg00/lvol2&lt;BR /&gt;reserve       -    8963   -8963&lt;BR /&gt;memory    18430    5148   13282   28%&lt;BR /&gt;total     34814   14138   20676   41%       -       0    -&lt;BR /&gt;</description>
      <pubDate>Thu, 12 Jun 2008 10:57:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/can-we-use-the-top-command-to-found-out-free-mem-in-the-hp-ux/m-p/5113688#M446484</guid>
      <dc:creator>Vinoyee Madashery Poulo</dc:creator>
      <dc:date>2008-06-12T10:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use the top command to found out free mem in the HP-UX system?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/can-we-use-the-top-command-to-found-out-free-mem-in-the-hp-ux/m-p/5113689#M446485</link>
      <description>Vinoyee,&lt;BR /&gt;&lt;BR /&gt;What I think is happening here, is that you are misunderstanding the output for swapinfo -tam,&lt;BR /&gt;the swapinfo output never talks about memory on the system, it only talks about swap, and the memory line only indicates how much pseudo-swap has been reserved, it does not refer in any moment about physical memory.&lt;BR /&gt;&lt;BR /&gt;I think this document will really help on your quest:&lt;BR /&gt;&lt;BR /&gt;ftp://eh:spear9@hprc.external.hp.com/memory.htm&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Jaime.</description>
      <pubDate>Thu, 12 Jun 2008 11:24:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/can-we-use-the-top-command-to-found-out-free-mem-in-the-hp-ux/m-p/5113689#M446485</guid>
      <dc:creator>Jaime Bolanos Rojas.</dc:creator>
      <dc:date>2008-06-12T11:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use the top command to found out free mem in the HP-UX system?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/can-we-use-the-top-command-to-found-out-free-mem-in-the-hp-ux/m-p/5113690#M446486</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;HP-UX defines memory as ram plus swap.&lt;BR /&gt;&lt;BR /&gt;# swapinfo -tam&lt;BR /&gt;Mb Mb Mb PCT START/ Mb&lt;BR /&gt;TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME&lt;BR /&gt;dev 16384 27 16357 0% 0 - 1 /dev/vg00/lvol2&lt;BR /&gt;reserve - 8963 -8963&lt;BR /&gt;memory 18430 5148 13282 28%&lt;BR /&gt;total 34814 14138 20676 41% - 0 - &lt;BR /&gt;&lt;BR /&gt;This output is cleared.&lt;BR /&gt;Overall, ram plus swap is a little less than 35 GB. 34814 KB&lt;BR /&gt;14 GB 14138 is free.&lt;BR /&gt;&lt;BR /&gt;The two lines above show actual use of memory.&lt;BR /&gt;&lt;BR /&gt;5 GB actually used, almost 9 GB of swap reserved but not actually used (see vmstat or top line of swapinfo output.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Thu, 12 Jun 2008 11:41:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/can-we-use-the-top-command-to-found-out-free-mem-in-the-hp-ux/m-p/5113690#M446486</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2008-06-12T11:41:12Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use the top command to found out free mem in the HP-UX system?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/can-we-use-the-top-command-to-found-out-free-mem-in-the-hp-ux/m-p/5113691#M446487</link>
      <description>Steven,&lt;BR /&gt;&lt;BR /&gt;My question was that can we use top command output to identify the available free memory in the system. I have compared the top, sam, crashinfo output and sam memory statistics and found that the top free mem statement is the actual free memory in that system. Is my findings are correct?</description>
      <pubDate>Thu, 12 Jun 2008 12:42:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/can-we-use-the-top-command-to-found-out-free-mem-in-the-hp-ux/m-p/5113691#M446487</guid>
      <dc:creator>Vinoyee Madashery Poulo</dc:creator>
      <dc:date>2008-06-12T12:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use the top command to found out free mem in the HP-UX system?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/can-we-use-the-top-command-to-found-out-free-mem-in-the-hp-ux/m-p/5113692#M446488</link>
      <description>Yes, top reports Free memory accurately. (I would expect it is simply reporting the field psd_free from struct pst_dynamic filled in by pstat_getdynamic() -- and since that is a reasonable approximation [being a snapshot, it isn't perfectly accurate by the time the syscall returns usually] of system wide free memory, it is a good value).&lt;BR /&gt;&lt;BR /&gt;As mentioned by others -- swapinfo has nothing to do with free memory, it reports memory *swap* which is not the same thing [and doesn't have to be enabled at all on v2]. It is entirely legal and reasonable for virtual objects to be created, reserve all their virtual address space from disk swap, touch their pages such that free memory is down to 1%... and memory swap will still be untouched (because only disk swap is needed).&lt;BR /&gt;&lt;BR /&gt;Point by point on your studies:&lt;BR /&gt;&lt;BR /&gt;1) Yes, or you could ask pstat directly. Glance or top should both report Free memory correctly. top should not be used to estimate system wide virtual or physical consumption (other than the simplistic Total - Free, which is reasonable) since the rest of top's memory metrics all deal solely with User process memory statistics. The kernel is not represented in top and is usually non-trivial.&lt;BR /&gt;&lt;BR /&gt;2) I would highly doubt it and can easily construct an example where this is not the case. (Take a system with 4Gb of memory and 8Gb of swap, shmmax of 12Gb and do a shmget() for a 10Gb object then shmat() to a process. Don't touch any pages. The process will report (and top will report in the totals) at least 10Gb virtually with no corresponding physical consumption (because the pages aren't touched). This is obviously much greater than total physical... as it should be or why bother doing Virtual Memory, anyway?)&lt;BR /&gt;&lt;BR /&gt;Virtual memory is much more representative of swap space reservation+consumption than physical consumption by default on HP-UX --&lt;BR /&gt;virtual objects must by default reserve backing swap. Only use of chatr for Lazy Swap (or specific flags to mmap(2), etc.) will allow virtual objects to be created which do not consume swap.&lt;BR /&gt;&lt;BR /&gt;top, glance and sam should (again) be using the same input for Free memory, so should agree. crashinfo is not a supported command but is a support-only tool. Running it for data on a live system is not something to be encouraged.&lt;BR /&gt;&lt;BR /&gt;3) swapinfo isn't reporting memory at all. See above. Memory swap doesn't have to even exist, much less be sized according to RAM consumption.&lt;BR /&gt;&lt;BR /&gt;And no -- it is also possible to get the converse. If you consider a diskless environment (or at least no disk/FS swap) as a hypothetical [since I'm not sure this is supported anyway], every virtual object would have to reserve from memory swap. Even if no pages were instantiated via fault, memory swap would go to zero -- while free memory could still be unchanged. (Yes, in practice there'd be consumption by metadata -- but the trend would be clear).&lt;BR /&gt;&lt;BR /&gt;I hope this makes it clear that memory swap and free RAM are entirely unrelated in consumption. The one time you can expect them to act in lockstep is in consumption of memory locked pages (mlock / plock or Kernel [implicitly locked]). These by default reserve from memory swap if it is enabled since there's no point in reserving disk swap for unswappable memory. And since these system calls (or kernel allocation paths) almost immediately then also allocate matching RAM, freemem will decrease by the same amount.&lt;BR /&gt;&lt;BR /&gt;My conclusion: pstat is a useful tool to get memory metrics. How you wrap pstat is up to you... top is one way, there are many others.</description>
      <pubDate>Thu, 12 Jun 2008 15:06:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/can-we-use-the-top-command-to-found-out-free-mem-in-the-hp-ux/m-p/5113692#M446488</guid>
      <dc:creator>Don Morris_1</dc:creator>
      <dc:date>2008-06-12T15:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use the top command to found out free mem in the HP-UX system?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/can-we-use-the-top-command-to-found-out-free-mem-in-the-hp-ux/m-p/5113693#M446489</link>
      <description>Thank you Don.</description>
      <pubDate>Fri, 13 Jun 2008 07:09:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/can-we-use-the-top-command-to-found-out-free-mem-in-the-hp-ux/m-p/5113693#M446489</guid>
      <dc:creator>Vinoyee Madashery Poulo</dc:creator>
      <dc:date>2008-06-13T07:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use the top command to found out free mem in the HP-UX system?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/can-we-use-the-top-command-to-found-out-free-mem-in-the-hp-ux/m-p/5113694#M446490</link>
      <description>Thank you one and all who spent time on this query</description>
      <pubDate>Fri, 13 Jun 2008 07:12:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/can-we-use-the-top-command-to-found-out-free-mem-in-the-hp-ux/m-p/5113694#M446490</guid>
      <dc:creator>Vinoyee Madashery Poulo</dc:creator>
      <dc:date>2008-06-13T07:12:22Z</dc:date>
    </item>
  </channel>
</rss>

