Closed PanosGreg closed 9 months ago
Hi Adam,
Hope you are keeping well.
By the way, it would be very helpful if you can also make a short YouTube video showcasing the functionality of this module.
I understand this module is a work based on what you've shown here but doing that in PS now, which is indeed a very good addition and very much appreciated.
Panos
I eventually went through the C# code of this repo which then lead me to the source clrMD repo from Microsoft.
So I ended up writing a function that uses the latest version of the RuntimeDiagnostics .dll's and calculates the memory sizes and counts for each .NET object here:
Here's the output when I run it in PowerShell v7.4.1
C:\> Add-Type -Path (dir 'C:\RuntimeDiagnostics\*\lib\netstandard2.0\*.dll').FullName
C:\> . C:\Scripts\Get-RuntimeDiagnostics.ps1
C:\>
C:\> Get-RuntimeDiagnostics -NumberOfItems 5 -Verbose
Memory Count Type
------ ----- ----
10.7MB 116989 System.String
2.2MB 54401 System.Collections.Concurrent.ConcurrentDictionary<System.String, System.Management.Automation.CommandTy…
1.45MB 45349 System.Management.Automation.Language.InternalScriptExtent
861KB 1120 System.Collections.Concurrent.ConcurrentDictionary<System.String, System.Management.Automation.CommandTy…
728KB 6996 System.Reflection.RuntimeMethodInfo
VERBOSE: Memory started at 71MB, peaked at 139MB, and ended at 95MB, thus used 23MB
C:\>
So I think we can close this issue.
The
Statistics
parameter does not exist inGet-ClrObject
I'm trying the following as per the readme.md
And I'm getting the error:
Module version:
0.0.1
PSVersion:7.3.4
Windows 10 22H2