<?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: Isolate top process consuming cpu and memory in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/isolate-top-process-consuming-cpu-and-memory/m-p/5507177#M606589</link>
    <description>&lt;P&gt;I've already corrected your command in your previous thread:&lt;/P&gt;&lt;P&gt;&lt;A href="http://h30499.www3.hp.com/t5/Languages-and-Scripting/Need-to-find-top-process-and-identify-the-PID/m-p/5480445" target="_blank"&gt;http://h30499.www3.hp.com/t5/Languages-and-Scripting/Need-to-find-top-process-and-identify-the-PID/m-p/5480445&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Jan 2012 21:32:43 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2012-01-24T21:32:43Z</dc:date>
    <item>
      <title>Isolate top process consuming cpu and memory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/isolate-top-process-consuming-cpu-and-memory/m-p/5506989#M606586</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;cpmtest&amp;gt; uname -a&lt;BR /&gt;HP-UX oradev1 B.11.23 U ia64 0074225043&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to isolcate top process in terms of memory and cpu. I am using following command to get those details.&lt;/P&gt;&lt;P&gt;it seems&amp;nbsp;to me, on HPUX, it may not be the command to achieve the desired result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;cpmtest&amp;gt; ps -e -o pcpu,pid,user,tty,args | sort -n -k 1 -r | head
ps: illegal option -- o
usage: ps [-edaxzflP] [-u ulist] [-g glist] [-p plist] [-t tlist] [-R prmgroup] [-Z psetidlist]
Usage: sort [-AbcdfiMmnru] [-T Directory] [-tCharacter] [-y kilobytes] [-o File]
           [-k Keydefinition].. [[+Position1][-Position2]].. [-z recsz] [File]..

cpmtest&amp;gt; ps -e -o pmem,pid,user,tty,args | sort -n -k 1 -r | head
ps: illegal option -- o
usage: ps [-edaxzflP] [-u ulist] [-g glist] [-p plist] [-t tlist] [-R prmgroup] [-Z psetidlist]
Usage: sort [-AbcdfiMmnru] [-T Directory] [-tCharacter] [-y kilobytes] [-o File]
           [-k Keydefinition].. [[+Position1][-Position2]].. [-z recsz] [File]..&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2012 18:08:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/isolate-top-process-consuming-cpu-and-memory/m-p/5506989#M606586</guid>
      <dc:creator>Alok_Behria</dc:creator>
      <dc:date>2012-01-24T18:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: Isolate top process consuming cpu and memory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/isolate-top-process-consuming-cpu-and-memory/m-p/5507061#M606587</link>
      <description>&lt;P&gt;The following should do what you want:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;UNIX95=1&amp;nbsp; ps -eo pcpu,pid,user,tty,args | sort -rnk 1,1 | head&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The key changes are:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Adding the UNIX95=1 to enable the XPG4 options to the 'ps' command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) Redoing the sort command.&amp;nbsp; The order you had the arguments in didn't work.&amp;nbsp; Having the '-r' last is not valid syntax.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2012 19:10:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/isolate-top-process-consuming-cpu-and-memory/m-p/5507061#M606587</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2012-01-24T19:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Isolate top process consuming cpu and memory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/isolate-top-process-consuming-cpu-and-memory/m-p/5507063#M606588</link>
      <description>&lt;P&gt;You coming from Solaris? The ps command works slightly different on HP-UX, and you need to be careful with your sort syntax as well...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By default, HP-UX uses its own ps implementation, to get it to behave like the UNIX 95 standard you need to set the UNIX95 environment variable, but typically you don't want it set by default, so if you want to use any of the command arguments/options listed as "UNIX Standard Only" on the ps man page, you do something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;UNIX95= ps -eo pcpu ...&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So your first command line becomes:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;UNIX95= ps -e -o pmem,pid,user,tty,args | sort -nr -k 1&amp;nbsp; | head&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(note I fixed your sort syntax as well)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For your second command line - there is no equivalent of pmem, so the closest you can probably get is vsz - so try:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;UNIX95= ps -e -o vsz,pid,user,tty,args | sort -nr -k 1&amp;nbsp; | head&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2012 19:13:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/isolate-top-process-consuming-cpu-and-memory/m-p/5507063#M606588</guid>
      <dc:creator>Duncan Edmonstone</dc:creator>
      <dc:date>2012-01-24T19:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: Isolate top process consuming cpu and memory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/isolate-top-process-consuming-cpu-and-memory/m-p/5507177#M606589</link>
      <description>&lt;P&gt;I've already corrected your command in your previous thread:&lt;/P&gt;&lt;P&gt;&lt;A href="http://h30499.www3.hp.com/t5/Languages-and-Scripting/Need-to-find-top-process-and-identify-the-PID/m-p/5480445" target="_blank"&gt;http://h30499.www3.hp.com/t5/Languages-and-Scripting/Need-to-find-top-process-and-identify-the-PID/m-p/5480445&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2012 21:32:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/isolate-top-process-consuming-cpu-and-memory/m-p/5507177#M606589</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2012-01-24T21:32:43Z</dc:date>
    </item>
  </channel>
</rss>

