Re: Memory consumption PowerShell



Hi Andrew!

The mechanism of the Identity Management system (it is Novell Identity
Manager 3.0 - we just call it IDM 3.0) is, that everey event that occours
with a user account intiate an action. The most actions are modify attributes
in the IDM an his connectes Drirectories, e.g. Open LDAP and Active
Directory. And we could initiate to run a script oout side the IDN 3.0. This
is the case we want to do, if a new user account was created. A few actions
are to modifiy the attributes, an one of the most last actions is to run a
script, that create a subdir, set NTFS rights an so on.
Now the Pronblem is, in many cases we have bulk-operatiuons with our user
accounts. So it can be normal that a few to thousands account are modified.
When in this case a script must be executed, than in a few seconds hundred or
thousand script instances are running. And every instance needs 28-30 MB
memory (it took this value over the TaskManager). And the PowerShell
start|running-script|terminate ist not so fast (the average runtime of a
"start|running-script|terminate" are 2-3 seconds. But the System call the
scripts faster as they terminate, so the memory consumption explode and crash
the Server (Windows Server 2003 SP1 with actual patch stand) with a blue
screen. I have test this scenario in a virtual machine environment.
To this, the normal size oc CMD.Exe are 2 MB. But the runtime is faster. If
have wrote a little script, that is equiv. to the powershellscript, but the
avarage runtime is very fast. The mechanism behind is, that within a java
program the function CreateProcess is called an this function needs a string
as parameter. This parameter contains the string with the .BAT-File and his
parameters. Now I'v look to the Server (now there runs a bulk operation) and
I dont see no CMD.Exe or Command.com instances. How is that implemented in
the Server APIs that a programm call to a .BAT ir .CMD Script consume so
minimal memory in the Server but the PS consumes 28 MB per instance?
Is there a chance, that the PowerShell run like this or how could we
minimize the memory consumption of the PS and how coould we minimize the
average runtime.

Any idea are welcome!
--
With best regards
Thorsten Hindermann


"Andrew Watt [MVP]" wrote:

Thorsten,

I can only surmise precisely what you want to do.

Have you tried something like this?

$users = [List of users]
foreach ($user in $users){
#tasks go here
}

I would be very surprised if that took up 28GB.

If the suggested approach doesn't work for you I suggest that you post
more detail on the scenario and precisely what it is that you want to
do.

Andrew Watt MVP

On Wed, 19 Jul 2006 23:43:02 -0700, Thorsten Hindermann
<ThorstenHindermann@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Hello Group!

I have following problem. We want to use the powershell with an Identity
Management System. Within a task from the IM System we must start a script
per person to make actions e.g. create a homedir path, set ACLs ...
The Problem now is, it could be that about a few till hundreds of person
identified, for which we must start an action with an pwoershell scipt. But
each(!) running instance consumes 28 - 30 MB memory. 28MB * (e.g.) 1000
acrions = 28.000 MB (28GB). To big for todays memory management.
How could I reduce this mmory consume????
Please help! Any idea are welcome!
Thanx



--
With best regards
Thorsten Hindermann

.



Relevant Pages

  • Re: Problem with ASP on Webserver
    ... No, I know the memory model, I have made my own Virtual memory dump program ... function in the script ... (Accept-Language:) ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Problem with ASP on Webserver
    ... Entrek's TOOLBOX is a lot better for memory stuff. ... function in the script ... (Accept-Language:) ...
    (microsoft.public.windowsce.platbuilder)
  • Critique my code: using Lisp to parse lots of "ps -elf" files in AIX
    ... It's my first use of Lisp at work, ... and another ksh script to analyze the output. ... success using them to diagnose some of their own memory problems, ... an hour to process about an hour's worth of data (i.e. 60 data files). ...
    (comp.lang.lisp)
  • Re: Incude statement - is there such a thing?
    ... I can't imagine any memory usage issues. ... And it that WSF references ... other script files (as the Docs often suggest to be ... > you had 50 statements that you wanted to execute 1000 times in a loop. ...
    (microsoft.public.scripting.vbscript)
  • Re: Memory Leaks?
    ... > not relinquish all memory back to the available pool for XP to use. ... To flesh this out a bit, memory leaks are a far greater problem in scripts ... When a script terminates, WSH runs a cleanup process that deletes the ... An object will be disconnected only after all references to it ...
    (microsoft.public.windowsxp.general)

Loading