Windows Vista Forums
Vista Forums Home Join Vista Forums Webcasts Windows 7 Forum Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

"Out of memory"

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 01-03-2007   #1 (permalink)
Jakob Bindslet
Guest


 

"Out of memory"

I have a rather large script, that performs several hundred Get-WmiObject
against various servers. Usually Get-WmiObject "Win32_Process" with various
filters.

Sometimes the script returns a "out of memory" error. But not always.

How can this best be handled in PowerShell ?

--
Jakob Bindslet



My System SpecsSystem Spec
Old 01-03-2007   #2 (permalink)
RichS
Guest


 

RE: "Out of memory"

Is it possible to split the script up into smaller pieces.
--
Richard Siddaway

Please note that all scripts are supplied "as is" and with no warranty


"Jakob Bindslet" wrote:

> I have a rather large script, that performs several hundred Get-WmiObject
> against various servers. Usually Get-WmiObject "Win32_Process" with various
> filters.
>
> Sometimes the script returns a "out of memory" error. But not always.
>
> How can this best be handled in PowerShell ?
>
> --
> Jakob Bindslet
>
>

My System SpecsSystem Spec
Old 01-03-2007   #3 (permalink)
Jakob Bindslet
Guest


 

Re: "Out of memory"

On Wed, 3 Jan 2007 05:17:00 -0800, RichS
<RichS@discussions.microsoft.com> wrote:

>Is it possible to split the script up into smaller pieces.


It would be possible, but I'd rather not.

I'm not even sure if the error occurs in PowerShell on in WMI - I've
been digging a bit into $error, but none of the properties gives me
ant insight into this matter.

--
Jakob Bindslet


My System SpecsSystem Spec
Old 01-03-2007   #4 (permalink)
RichS
Guest


 

Re: "Out of memory"

Do you generate a new object for each WMI call.

could try setting a trap

trap [OutofMemoryException]{........

--
Richard Siddaway

Please note that all scripts are supplied "as is" and with no warranty


"Jakob Bindslet" wrote:

> On Wed, 3 Jan 2007 05:17:00 -0800, RichS
> <RichS@discussions.microsoft.com> wrote:
>
> >Is it possible to split the script up into smaller pieces.

>
> It would be possible, but I'd rather not.
>
> I'm not even sure if the error occurs in PowerShell on in WMI - I've
> been digging a bit into $error, but none of the properties gives me
> ant insight into this matter.
>
> --
> Jakob Bindslet
>
>
>

My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unwanted Multiple contacts in "To","CC","BCC" of email send catago xsailer Vista mail 2 2 Days Ago 06:18 PM
Vista not wotking with "My Computer" or "Control Panel", "Screen Saver" Platebanger Vista General 6 02-05-2008 08:54 AM
How to change my pro duo memory card from "write-only" in windows vista? David N Vista hardware & devices 0 10-13-2007 01:50 AM
How can I add the icons "Delete", "Cut", "Copy" and "Paste" in Vis Moonwalker Vista file management 7 09-17-2007 05:55 PM
WM5 Sync with Vista "Windows Calender", "Contacts", and "Mail" Tony Vista General 1 02-16-2007 06:20 PM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51