<?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 wrong data in pstat_getproc in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/wrong-data-in-pstat-getproc/m-p/3900116#M96599</link>
    <description>in top (for HPUX) one process has an amount of virtual memory and a resident set size of memory.&lt;BR /&gt;example:&lt;BR /&gt;&lt;BR /&gt;CPU TTY     PID USERNAME PRI NI   SIZE    RES STATE    TIME %WCPU  %CPU COMMAND&lt;BR /&gt; 0 pts/tf 13269 hpfms    152 20 42400K  8116K run      0:00 14.47  2.02 fmsarchive_server.exe&lt;BR /&gt;&lt;BR /&gt;With pstat_getproc the results for this pid is:&lt;BR /&gt;&lt;BR /&gt;8116 for &lt;BR /&gt;t-&amp;gt;rss = pst[i].pst_rssize&amp;lt;&lt;PAGESHIFT&gt;&lt;/PAGESHIFT&gt;5196 for t-&amp;gt;size = (pst[i].pst_tsize + pst[i].pst_dsize + pst[i].pst_ssize)&amp;lt;&lt;PAGESHIFT&gt;&lt;/PAGESHIFT&gt;for virtual &lt;BR /&gt;&lt;BR /&gt;what happens? and why?&lt;BR /&gt;&lt;BR /&gt;I compile with:&lt;BR /&gt;#if !defined(_PSTAT64)&lt;BR /&gt;#define _PSTAT64&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;and in compiler:&lt;BR /&gt;CDEFS = -O -Ae -D_PSTAT64&lt;BR /&gt;&lt;BR /&gt;thanks in advance</description>
    <pubDate>Fri, 17 Nov 2006 08:04:04 GMT</pubDate>
    <dc:creator>Aurelio Rodriguez_1</dc:creator>
    <dc:date>2006-11-17T08:04:04Z</dc:date>
    <item>
      <title>wrong data in pstat_getproc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/wrong-data-in-pstat-getproc/m-p/3900116#M96599</link>
      <description>in top (for HPUX) one process has an amount of virtual memory and a resident set size of memory.&lt;BR /&gt;example:&lt;BR /&gt;&lt;BR /&gt;CPU TTY     PID USERNAME PRI NI   SIZE    RES STATE    TIME %WCPU  %CPU COMMAND&lt;BR /&gt; 0 pts/tf 13269 hpfms    152 20 42400K  8116K run      0:00 14.47  2.02 fmsarchive_server.exe&lt;BR /&gt;&lt;BR /&gt;With pstat_getproc the results for this pid is:&lt;BR /&gt;&lt;BR /&gt;8116 for &lt;BR /&gt;t-&amp;gt;rss = pst[i].pst_rssize&amp;lt;&lt;PAGESHIFT&gt;&lt;/PAGESHIFT&gt;5196 for t-&amp;gt;size = (pst[i].pst_tsize + pst[i].pst_dsize + pst[i].pst_ssize)&amp;lt;&lt;PAGESHIFT&gt;&lt;/PAGESHIFT&gt;for virtual &lt;BR /&gt;&lt;BR /&gt;what happens? and why?&lt;BR /&gt;&lt;BR /&gt;I compile with:&lt;BR /&gt;#if !defined(_PSTAT64)&lt;BR /&gt;#define _PSTAT64&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;and in compiler:&lt;BR /&gt;CDEFS = -O -Ae -D_PSTAT64&lt;BR /&gt;&lt;BR /&gt;thanks in advance</description>
      <pubDate>Fri, 17 Nov 2006 08:04:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/wrong-data-in-pstat-getproc/m-p/3900116#M96599</guid>
      <dc:creator>Aurelio Rodriguez_1</dc:creator>
      <dc:date>2006-11-17T08:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: wrong data in pstat_getproc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/wrong-data-in-pstat-getproc/m-p/3900117#M96600</link>
      <description>Well, first of all -- you aren't adding the virtual in what you stated. pst_tsize, pst_dsize and pst_ssize are the resident (physical) sizes of Text, Data and Stack respectively. So all your calculation above indicates is that about 2,920K [assuming you're outputting K.. if you were really shifting by pageshift, your calculation should be producing an amount in bytes.. so your "pageshift" is probably "bytes per page / 1024"] of the physical memory used by this process is either MMAP, SysV shared memory, UAREA or if you're on IPF in the RSE Stack. [MMIO is the other one, and MMIO by definition shouldn't have a RSS component].&lt;BR /&gt;&lt;BR /&gt;If you want virtual, you need to look at pst_vtsize, pst_vdsize and pst_vssize. However -- that still wouldn't add up... because a process isn't only Text+Data+Stack. Your virtual total should also include pst_vmmsize (MMAP), pst_vshmsize(SysV Shmem) and pst_vusize (thread UAREAs). Include pst_vrsesize for the RSE stack on IPF if need be.</description>
      <pubDate>Fri, 17 Nov 2006 09:22:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/wrong-data-in-pstat-getproc/m-p/3900117#M96600</guid>
      <dc:creator>Don Morris_1</dc:creator>
      <dc:date>2006-11-17T09:22:43Z</dc:date>
    </item>
  </channel>
</rss>

