| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
The change is causing a lot memory allocations as compared to before. Scenario: measure-command { 1..10kb | ForEach-Object -Parallel { }} Before change: 105 MB in 2.6 minutes |
Sorry, something went wrong.
Dismiss Aditya's review given his new finding regarding the PR.
|
Aditya Patwardhan (@adityapatwardhan) As long as the CLR eventually collects the memory, I think we are Ok. I have run tests that loop for hours, detecting handle and working set usage. So far I see the usage plateau after a while so there seems to be no resource leak. However, the CLR and GC is getting a lot of exercise! |
Sorry, something went wrong.
|
Speed is awesome, but I don't think most folks will agree that... what, 10 gigabytes(?) of RAM usage for a task that is literally doing no work is something they'll want to work with regularly if at all. Are currently available alternatives this excessive in terms of memory usage? (e.g., PoshRSJobs?) |
Sorry, something went wrong.
|
Rain Sallow (/u/ta11ow) (@vexx32) measure-command { 1..10kb | ForEach-Object -Parallel { }}
The code is useless and is essentially creating 100s of thousands of managed objects and releasing them as fast as possible. It is no surprise that memory usage peaks until GC can deal with it. This is more about managed code and the CLR than about PowerShell. You can do the same thing by writing silly C# code. |
Sorry, something went wrong.
|
🎉v7.0.0-preview.4 has been released which incorporates this pull request.:tada: Handy links: |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
This is a fix for the ForEach-Object perf Issue: #10450.
PR Context
The problem was that the number of concurrent runspaces was being limited to around 40-50, even though the ThrottleLimit was set to 300. It turns out it was the Cmdlet input processing thread that was causing the bottleneck. I don't know what the conflict is while spinning up runspaces, but the fix is to now do this on a dedicated thread similar to how it currently works for -AsJob.
PR Checklist