Trying to execute the following command on a heavily utilized vCenter, fails with "Out of Memory" exception. It has 32Gb of RAM though. What can we go to fix this one....the same works fine on other vCenters.
Execute: $Script:hosts = Get-View -ViewType HostSystem -Filter @{"Runtime.ConnectionState"="connected"} -Property Name,Runtime,Hardware,Datastore,Config.FileSystemVolume.MountInfo,Config.StorageDevice.scsiLun,Config.StorageDevice.HostBusAdapter,Config.StorageDevice.MultipathInfo,Config.Product,Config.Network,Config.Option Get-View : 17/08/2011 09:35:49 Get-View 46D80EFB-1716-4E39-904E-BADF68D3D 2F8 Exception of type 'System.OutOfMemoryException' was thrown.
Did you check the memory consumption before and after this Get-View cmdlet ?
Just do
gps -id $pid
Perhaps you can try to lower the amount of memory in use before running the Get-View cmdlet with
[System.GC]::Collect()
But I also seem to see an important increase in the size of the WorkSpace during the execution of this Get-View statement.
Does a simple
Get-View -ViewType HostSystem
experience the same execption ?
How many hosts should it return ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi Luc,
Tried the garbage collector but it still fails. vCenter has 200+hosts.
Script is running as 32-bit process on 64-bit server with 32gb memory. (canot run as 64-bit for now, need to debug)
What else can i try ? I watched memory consumption, it never seem to cross few hundred megs.
Thanks for helping out.
I'm afraid I'm out of ideas.
I suggest the PowerCLI Dev Team should have a look.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
