OsProcessInfo
Description
Instances of this class are the result of calling OsNativeProcess>>info on a running process and contain information about the process at the time the request for info was made.
These infos can be cached, but keep in mind that some fields are temporal, and re-queries should be done to make sure this is up-to-date.
Accessibility
A native process has a lifecycle of its own. A smalltalk handle may be available on a native process, but at any time that native process can terminate. An info is always answered from a OsNativeProcess>>info, but it should be discarded if OsProcessInfo>>ifAccessible is false.
  • #isAccessible - true if process still active and avaiable to answer info queries
  • #ifAccessible: [] - If info is accessible then evaluate if block
  • #ifAccessible: [] else: [] - If info is accessible then evaluate if block, otherwise else block
Information
  • #arguments - process arguments
  • #command - process command
  • #commandLine - process command line
  • #currentRss - process resident set size in bytes
  • #maxRss - process maximum resident set size in bytes
  • #startTime - locale tz start time of the process
  • #startTimeUTC - UTC start time of the process
  • #totalCpuDuration - total active cpu time used by the process
  • #user - process user
Class Methods
<details> from:convertToCodePage:
<pre><code> Answer a new instance of process info
Arguments:
anInfoArray - <Array> primitive info array
aBoolean - <Boolean> convert known UTF-8 strings to current codepage
Answers:
<OsProcessInfo>
</code></pre> </details>
Instance Methods
<details> arguments
<pre><code> Answer the arguments for the process
Answers:
<Array> of <String> or nil
</code></pre> </details>
<details> command
<pre><code> Answer the command name of the process
Answers:
<String> or nil
</code></pre> </details>
<details> commandLine
<pre><code> Answer the command line for the process
Answers:
<String> or nil
</code></pre> </details>
<details> currentRss
<pre><code> Answer the current resident set size (in bytes) for the process.
The resident set size (RSS) is the amount of physical memory (RAM)
held by a process

Answers:
<Integer> or nil
</code></pre> </details>
<details> ifAccessible:
<pre><code> If this info is accessible, then evaluate this info with @anAccessibleBlock Otherwise, answer nil
Arguments:
anAccessibleBlock - <Block> 0 or 1-arg that accepts this info
Answers:
<Object> result of evaluating either @anAccessibleBlock
<UndefinedObject> nil if info not accessible
</code></pre> </details>
<details> ifAccessible:else:
<pre><code> If this info is accessible, then evaluate this info with @anAccessibleBlock Otherwise, evaluate this info with @anElseBlock
Arguments:
anAccessibleBlock - <Block> 0 or 1-arg that accepts this info
anElseBlock - <Block> 0 or 1-arg that accepts this info
Answers:
<Object> result of evaluating either @anAccessibleBlock or @anElseBlock
</code></pre> </details>
<details> isAccessible
<pre><code> Processes that have terminated and cleaned-up all their resources may not be able to answer any information about themeselves which means it is not accessible.
Answers:
<Boolean> true if accessible, false otherwise
</code></pre> </details>
<details> maxRss
<pre><code> Answer the maximum resident set size (in bytes) that has been held by the process.
The resident set size (RSS) is the amount of physical memory (RAM)
held by a process

Answers:
<Integer> or nil
</code></pre> </details>
<details> startTime
<pre><code> Answer the locale tz start time of the process. Use #startTimeUTC if you want the DateAndTime in terms of UTC
Answers:
<DateAndTime> or nil
</code></pre> </details>
<details> startTimeUTC
<pre><code> Answer the UTC start time of the process. Use #startTime if you want the result to be timezone local
Answers:
<DateAndTime> or nil
</code></pre> </details>
<details> totalCpuDuration
<pre><code> Answer the total time the processor has been activley used for this process
Answers:
<Duration> or nil
</code></pre> </details>
<details> user
<pre><code> Answer the user of the process
Answers:
<String> or nil
</code></pre> </details>
Last modified date: 07/07/2022