Display PM and WS in MB instead of KB#2927
Display PM and WS in MB instead of KB#2927lzybkr merged 1 commit intoPowerShell:masterPowerShell/PowerShell:masterfrom faheel:kilo-to-megaCopy head branch name to clipboard
Conversation
|
Hi @faheel, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! TTYL, MSBOT; |
There was a problem hiding this comment.
I would use 1mb instead of 1024 * 1024 because PowerShell does not implement constant folding.
I think I would also use :N2 instead of :N3, I don't think we require that much precision and helps avoid exceeding the maximum column width now that we see a . that wasn't there before.
There was a problem hiding this comment.
Yes, changing 1024 * 1024 to 1MB would be better. I didn't know that before.
As for the precision, if we use :N2 then for processes which take up 1-9KB of memory, it would be shown as 0.00, whereas using :N3 would show, for example, 0.005, which is the correct value.
There was a problem hiding this comment.
I suppose seeing 0.00 looks wrong and some might investigate, that extra character is also causing problems - here is an example that I just tested with your changes:
2663 ...6.016 0.004 11940 0 vmmem
2655 ...6.016 234.953 12720 0 vmmem
And to me - this is worse - I worry more about processes using a lot of memory than those using little memory.
There was a problem hiding this comment.
Ah yes, that's bad.
Should I change the precision of both PM and WS to 2, or just for PM?
(Width of PM's column is 8, while that of WS is 10. Any thoughts on that?)
There was a problem hiding this comment.
I think we should use N2.
A process using 5kb will show .01 because that gets rounded up, and very few processes use less than 5kb.
I also noticed in your screenshot that the CPU is showing 3 places after the decimal on Linux but we only see 2 on Windows. I think it's reasonable to use N2 for CPU to be consistent b/w Windows and Linux.
Modify output of Get-Process to display PM and WS in MB instead of KB Change 1024*1024 to 1MB Changed 1024*1024 to 1MB and merged commits Change precision of CPU time to 2 Display PM,WS in MB. Change precision of PM,WS,CPU to 2
Modify output of Get-Process to display PM and WS in MB instead of KB. Also change precision of CPU time to 2.

Modify output of Get-Process to display PM and WS in MB instead of KB.
Closes #2910
This is how it looks after the changes:

(Command run:
Get-Process | Sort-Object -Descending WS)