Re: Memory consumption PowerShell



Hello again!

Why need a running CMD.Exe on Windows Server 2003 only 144 KB??? On my
Windows XP System an instance needs round about 2 MB??
--
With best regards
Thorsten Hindermann


"Thorsten Hindermann" wrote:

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: ANY Win32_Printer query leaks ~500kbytes in wmiprvse.exe
    ... I can't repro this problem you are describe below is all, ... All the script does below is put the remote server into a loop and does what ... >> Use of memory by Windows is much more complex than most of us know about. ...
    (microsoft.public.win32.programmer.wmi)
  • Re: Reboot command no longer works in Task Scheduler
    ... You can script it. ... Fixing the memory leak and blue screen stop error makes the best sense to me. ... Server event viewer log file, if there are IDs such as 8250, 8026, 2102, then ...
    (microsoft.public.win2000.general)
  • Re: Segmentation fault in php5-imap
    ... The PHP memory limit is 512 Mb and server has 16Gb of RAM, so it doesn't look like its exhausting all the memory, although one of the libraries potentially could? ... It looks like the script is dropping connection to the NNTP server. ...
    (php.general)
  • zipping problem
    ... Right I have a script that zips files on the fly. ... and the server can't hold a 25Mb string in memory ... So I was thinking is working out the max size the server can ... and breaking the zipped files up into smaller files so the ...
    (alt.php)
  • Re: How To avoid out of memory Error in AIX 5.3 server ?
    ... Configure your server so that it creates dump-files when crashing on ... programmers did store in memory and forgot to release. ...
    (comp.unix.aix)