<p>What is the correct way to get the process size on <code>Solaris, HP-UX</code> and <code>AIX</code>? Should we use <code>top</code> or <code>ps -o vsz</code> or something else?</p>

[{'answer_id': 1082, 'author': 'Mark Harrison', 'author_id': 116, 'author_profile': 'https://Stackoverflow.com/users/116', 'pm_score': 2, 'selected': False, 'text': '<p>Yes, you are right to lock at the VSZ.</p>\n\n<p><code>ps u</code> will give you the VSZ and RSS, which are the virtual memory size and resident set size.  The RSS is how much physical memory has been allocated to the process, and the VSZ is the virtual memory size of the process.  If you have several copies of a program running, a lot of the memory in the VSZ will be shared between those processes.</p>\n'}, {'answer_id': 1773, 'author': 'John Siracusa', 'author_id': 164, 'author_profile': 'https://Stackoverflow.com/users/164', 'pm_score': 5, 'selected': True, 'text': '<p>The exact definitions of <code>vsize</code>, <code>rss</code>, <code>rprvt</code>, <code>rshrd</code>, and other obscure-looking abbreviations vary from OS to OS.  The manual pages for the <code>top</code> and <code>ps</code> commands will have some sort of description, but all such descriptions are simplified greatly (or are based on long-extinct kernel implementations).<br>\n"Process size" as a concept is fiendishly difficult to pin down in the general case.  Answers in specific instances depend heavily on the actual memory management implementation in the OS, and are rarely as satisfying as the tidy "process size" concept that exists in the minds of most users (and most developers).</p>\n\n<p>For example, none of those numbers (nor, likely, any combination of them) can be used to tell you exactly how many such processes can run at once in a given amount of free memory.  But really, your best bet is to come at it from that end: why do you want this number, and what will you use it for?  Given that information, I think you\'ll get more useful answers.</p>\n'}, {'answer_id': 107267, 'author': 'TLS', 'author_id': 19417, 'author_profile': 'https://Stackoverflow.com/users/19417', 'pm_score': 2, 'selected': False, 'text': '<p>On Solaris, you can get detailed information on a process\'s memory usage with the <code>pmap</code> command. In particular, <code>pmap -x &lt;pid&gt;</code> shows you how much of a process\'s memory is shared and how much is specifically used by that process. This is useful for working out the "marginal" memory usage of a process -- with this technique you can avoid double-counting shared libraries.</p>\n'}, {'answer_id': 22536892, 'author': 'Jay Sheth', 'author_id': 2761777, 'author_profile': 'https://Stackoverflow.com/users/2761777', 'pm_score': 2, 'selected': False, 'text': "<p>I summed up the resident set size for all processes like this (as root):</p>\n\n<pre><code>ps ax -o rss | awk '{rss += $1;} END { print rss}'\n</code></pre>\n"}]
['https://Stackoverflow.com/questions/1070', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/236/']