This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Repository navigation
[release/3.1] Read values from /proc/[pid]/status (#41122) - #42370
Merged
Merged
Conversation
* Fix #23449 - Read values from /proc/[pid]/status * Fix tests for new returned data from /prod/[pid]/status * Update tests of process info on OSX * Rename property ParsedStatus.pid --> ParsedStatus.Pid * 1. Avoid reallocation of delimiter array 2. Use tryParse instead of Parse to avoid exceptions * Rename static field and mark it as readonly * Change pid from /status to be read only from debug mode * Change status file read implementation using spans * Remove unecessary debug statement * Revert "Remove unecessary debug statement" This reverts commit f60b4f3. * Refactor logic using if statements with reduction in code redundancy * Improve condition arrangement to avoid reading subsequent files if process name doesn't match * Avoid failure of process info creation in case of fail read from one of many files. * Refactor Interop.ProcFsStat for better understanding * Change process creation logic to fail on read /stat * Change logic for unit and non unit values in file
stephentoub
approved these changes
Nov 4, 2019
Author
|
Approved by Steve |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port of #41122
Fixed #23449
Fixed #36086
Summary
Adds or improves results for several memory stats on Linux.
Add support for:
Process.PeakWorkingSet64
Process.PrivateMemorySize64
Process.PagedMemorySize64
Process.PagedSystemMemorySize64
Process.PeakVirtualMemorySize64
Improves:
Process.VirtualMemorySize64
Process.WorkingSet64
Customer Impact
This prevents some profilers from providing full memory information for services running on Linux, eg.,
Fixing this makes it easier for customers to monitor and diagnose issues on their services through telemetry. There is a desire to get this into an LTS release for this purpose.
Regression?
No, these have never worked on Linux.
Testing
Unit tests have been modified to require non zero values on Linux. This change does not fix OSX.
Risk
Affects reading of any process information on Linux (eg., GetProcessesByName). Previously it would read
/proc/<pid>/statand now it also reads/proc/<pid>/statusto gather the other information. The risks include, slower performance from reading two files (although, Linux is already slower than Windows); bugs in reading the file could throw - although we catch IOException; bugs parsing the file could throw or produce garbage.cc @stephentoub does the text above seem reasonable? Could you please sign off on the port? I just did cherry pick.