[Not for merging] Mapping different kinds of memory between System.Diagnostics.Process and Process Explorer #673
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.
Used OTel Console Exporter to log out different fields of System.Diagnostics.Process and compare them with the values reported by Process Explorer.
The export interval of Console Exporter was set to be 1 second and so does the refresh interval of Process Explorer.
Process Explorer does not support exporting a snapshot at a given timestamp; therefore, the snapshot below from Process Explorer was taken from manually.
The timestamp difference between the console log from Console Exporter and the values observed from Process Explorer should be less than 2 seconds.
This is the name-mapping table based on the above observation:
From OTel Process Spec,
the "process.memory.virtual" instrument should be reflecting "The amount of committed virtual memory."
The definition of committed virtual memory from Mark Russinovich's blogpost is defined as:
"There are two types of process virtual memory that do count toward the commit limit: private and pagefile-backed."
Windows tracks the private bytes usage with the Private Bytes performance counter. While there are no process-specific counter to look for pagefile-backed virtual memory.
Due to the above mentioning reasons, and the fact that there is no existing field from System.Diagnostic.Process to get pagefile-backed virtual memory usage, I propose to use "private virtual memory dedicated to the currentProcess" as the description for the .NET implementation of the gauge "process.memory.virtual".