Hi all,
First, a quick background in PowerShell. If I say $events = Get-VIEvent -MaxSamples (::MaxValue), I use RAM. The expected behavior would be that everything is stored in RAM. On the otherhand, Get-VIEvent -MaxSamples ([int]::MaxValue) | Foreach-Object {$null} stream event objects in the pipeline and NOT increase my memory use significantly.
So, with that out of the way, Get-VIEvent -MaxSamples ([int]::MaxValue) | Foreach-Object {$null} is literally using up all my RAM. I am sitting at 8 GB of RAM used.
Not sure where to file it, but this is a bug IMHO. The Get-VIEvent command is clearly storing data instead of forwarding it along the pipeline.
Any tips? Going to try http://psvmware.wordpress.com/2012/11/09/get-vievent-to-slow-boosting-get-vievent/...
Thanks!
Warren
Your PowerShell remark is correct, but then again the Get-VIEvent cmdlet uses the underlying EventCollector.
It's probably in there that the memory consumption is happening.
If you are only looking for specific events, you can do the filtering on the vSphere server.
Which will limit the number of returned objects.
Have a look at my Get-VIEventPlus function from Get the vMotion/svMotion history
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
LucD
I ended up using your function with the types parameter and code added from the link in my original post.
Went from filling up over 16 GB RAM without completing, over an hour or so, to less than 3 seconds....
Thanks for the great function!
You're welcome, glad it helped
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference