-ve value in powershell with command ps- for attributes PM(K) VM(M)

-ve value in powershell with command ps- for attributes PM(K) VM(M)
what does that -ve value mean? how should I interpret it.

If we ignore tomcat process  for sometime, my question is why we will get a -ve value and how should I understand it/2017-11-02-12_53_45-Document1---Word.png
porambokuAsked:
Who is Participating?
 
oBdACommented:
That's just an overflowing 32bit counter, and it means you're using an old version of Powershell (use $PSVersionTable to find out).
The negative ones you see are actually aliases for the real properties:
Run the following command to see the aliases:
ps | select -first 1 | gm -MemberType AliasProperty

Open in new window

You'll probably get something like this:
   TypeName: System.Diagnostics.Process

Name    MemberType    Definition
----    ----------    ----------
Handles AliasProperty Handles = Handlecount
Name    AliasProperty Name = ProcessName
NPM     AliasProperty NPM = NonpagedSystemMemorySize
PM      AliasProperty PM = PagedMemorySize
SI      AliasProperty SI = SessionId
VM      AliasProperty VM = PagedMemorySize
WS      AliasProperty WS = WorkingSet

Open in new window

What you should get is something like this (note the 64 at the end of some of the properties):
   TypeName: System.Diagnostics.Process

Name    MemberType    Definition
----    ----------    ----------
Handles AliasProperty Handles = Handlecount
Name    AliasProperty Name = ProcessName
NPM     AliasProperty NPM = NonpagedSystemMemorySize64
PM      AliasProperty PM = PagedMemorySize64
SI      AliasProperty SI = SessionId
VM      AliasProperty VM = PagedMemorySize64
WS      AliasProperty WS = WorkingSet64

Open in new window

The object's definition is documented here:
Process Properties
https://msdn.microsoft.com/en-us/library/system.diagnostics.process_properties.aspx
Note that NonpagedSystemMemorySize, PagedMemorySize, PagedMemorySize, WorkingSet are all marked "Obsolete", because they're 32bit values and can (and will, like in your case) overflow on a 64bit system. They've been replaced with the respective ...64 values.

For further processing of the values, use the ...64 properties.
For console output compatible to the default one, use this:
Get-Process | Format-Table -AutoSize -Property `
	Handles,
	@{n='NPM(K)';	e={[math]::Round($_.NonpagedSystemMemorySize64 / 1KB)}},
	@{n='PM(K)';	e={[math]::Round($_.PagedMemorySize64 / 1KB)}},
	@{n='WS(K)';	e={[math]::Round($_.WorkingSet64 / 1KB)}},
	@{n='CPU(s)';	e={[math]::Round($_.CPU, 2)}},
	Id,
	SI,
	ProcessName

Open in new window

Edit:Made the (K) entries actually "K"s, rounded CPU to two decimals like the original.
1
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.