Simply importing Microsoft.Graph.Identity.Governance v2.23.0 gobbles up more than 500MB of RAM / memory!
This is especially a problem when running in memory restricted environments like Azure Automation Account.
Screenshots going from pwsh -noprofile with PowerShell v7.4.5 x64 on Windows 11 23H2.
Clean start, idles at around 30 MB.
Import Microsoft.Graph.Authentication, does not take up much. Great.
Importing Microsoft.Graph.Identity.Governance makes pwsh.exe idle at almost 500 MB. Ouch. I've seen this idle around 500-600 MB at other times.
Expected behavior
Don't take hundreds of MB of RAM.
How to reproduce
See "Describe the bug"
SDK Version
2.23.0
Latest version known to work for scenario above?
No response
Known Workarounds
In resource limited environments, like Azure Automation Account, use Microsoft.Graph.Authentication only with cmdlet Invoke-MgGraphRequest to do API requests, instead of using other resource heavy Microsoft.Graph modules.
In my example, replace:
Microsoft.Graph.Identity.Governance\Get-MgIdentityGovernancePrivilegedAccessGroupAssignmentScheduleInstance -All -Filter (
'groupId eq ''{0}'' and endDateTime ne null' -f $PimGroup.'id'
)
Describe the bug
Simply importing
Microsoft.Graph.Identity.Governance
v2.23.0 gobbles up more than 500MB of RAM / memory!This is especially a problem when running in memory restricted environments like Azure Automation Account.
Screenshots going from
pwsh -noprofile
with PowerShell v7.4.5 x64 on Windows 11 23H2.Clean start, idles at around 30 MB.
Import
Microsoft.Graph.Authentication
, does not take up much. Great.Importing
Microsoft.Graph.Identity.Governance
makes pwsh.exe idle at almost 500 MB. Ouch. I've seen this idle around 500-600 MB at other times.Expected behavior
Don't take hundreds of MB of RAM.
How to reproduce
See "Describe the bug"
SDK Version
2.23.0
Latest version known to work for scenario above?
No response
Known Workarounds
In resource limited environments, like Azure Automation Account, use
Microsoft.Graph.Authentication
only with cmdletInvoke-MgGraphRequest
to do API requests, instead of using other resource heavyMicrosoft.Graph
modules.In my example, replace:
with
You'll have to handle paging yourself with this approach.
Debug output
Click to expand log
```Configuration
No response
Other information
No response