Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I was making some verifications with Powershell Get-Process cmdlet and got some weird values about some processes. I tested on a server with a SQL Server Instance running and consuming 3GB+ RAM as Resource Monitor reported, and when running Get-Process, I got negative values for WorkingSet on the SQL server process, another process is consuming 2GB+ of PrivateMemorySize and got the same negative value on PM.

Below are screenshots of the results.

Resource Monitor The OS is in portuguese, sorry.

Powershell:

enter image description here Check sqlservr and the last scvhost...

Luckily my script uses WMI (Win32_Process class) to get the processes informations, and the values there are correct and everything matches..

Is it a bug? Maybe with big values? I'm using Powershell v3.

share|improve this question

1 Answer 1

up vote 5 down vote accepted

Is this an x64 Server? If so, it's possible this blogpost explains your issue. Apparently it has to do with the way the get-process reads x64 systems memory:

The reason the poster was seeing negative numbers is fairly simple: the WS property is aliased to WorkingSet, but WorkingSet is a 32-bit value. In the poster’s case, the working set size overflowed the 32-bit value, resulting in a negative number being displayed.

The solution according to the blog is ultimately to enforce formatting of the query result:

$process = “*SQL"*” GPS $process | ft name, workingset64 –auto

share|improve this answer
    
Thanks, I suspected it had something with values sizes and so on. Also, I can only get the correct results when running the command locally on the server, if I run remote with the -ComputerName parameter, I get the same negative results. Running with PSSession works fine. –  esserafael Aug 29 '14 at 12:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.