Re: ManagementEventWatcher.start=OutOfMemoryException

From: Ryan Ackerman (Ryan_at_SofTulz.Net)
Date: 04/14/04


Date: Tue, 13 Apr 2004 20:27:01 -0700

When I've encountered this in the past it has been because the provider on
the target system really didn't have enough memory to service the request...
have you tried another 2k system? How many entries are in the event log?
What are the system specifics?

-- 
Ryan Ackerman
http://www.SofTulz.Net
SofTulz.Net, Providing Administrators with more free time through
automation.
Ryan@SofTulz.Net
"Willy Denoyette [MVP]" <willy.denoyette@pandora.be> wrote in message
news:uYsd8PNIEHA.3988@tk2msftngp13.phx.gbl...
> Did you inspect the wbem logfiles?
(%sysdir%\system32\wbem\logs\xxxx.log),
> maybe you should try to set logmode verbose to get more log details.
>
> Willy.
>
> "Manfred Braun" <aa@bb.cc> wrote in message
> news:eJU9fENIEHA.2128@TK2MSFTNGP11.phx.gbl...
> > Hello Willy and All,
> >
> > in the meantime, I grabbed out an old script, which does similar the
same
> > and astoundingly, it produces the same error. The exact output from the
> > catch in C# is:
> >
> > Exception:System.OutOfMemoryException: Not enough storage is available
to
> > complete this operation.
> >   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32
> > errorCode, IntPtr errorInfo)
> >   at System.Management.ManagementEventWatcher.Start()
> >   at EventlogTestWatcher.Run() in
> >
d:\Develop\Dev\Experimente\cs\Projetcs\EventlogCollectorService\Tools\Eventl
> > ogTestWat
> > cher1.cs:line 88
> >
> > [Sorry, this is a more full blown version, but pricipially the same;But
so
> > the line-number is naturally another on].
> > And I cannot imagine, what type of storage could be meant, disk and
memory
> > are all enough present.
> >
> >
> > About the "authority": This is how [if ;-) ] I understand WMI. In this
> > case
> > the authority is the remote machine itself, where the given user must
> > exist
> > and has that password. BTW, not to mention, the accounts all have admin
> > rights there. I have to specify different user/pass for each machine to
> > connect to, but this is an exception, my most machines are
domain-members.
> > If I am back into work tomorrow, I'll test a W2k-W2K query using a
> > domain-account having admin rights on both sides - but this is not my
> > requested need :-(
> > The code works the same, if I omit the "Authority" and specify the
> > "computer\user" syntax for the username.
> >
> >
> > I just added
> >
> >  co.Impersonation = ImpersonationLevel.Impersonate;
> >  co.Authentication = AuthenticationLevel.Connect;
> >
> > to the code, but the error remains the same.
> > I remember, that there were changes to the default DCOM security
settings
> > between different OS versions, but I do not exactly remember, which
> > difference. I have had a look at all my testmachines with DCOMCNFG and
the
> > settings are all the same, for NT4/W2K/XP [connect/identify].
> >
> > Thanks for your help so far!!!
> > Best regards,
> > Manfred
> >
> > "Willy Denoyette [MVP]" <willy.denoyette@pandora.be> wrote in message
> > news:%23XdymmMIEHA.3848@tk2msftngp13.phx.gbl...
> >> Can't try it out right now, but here are some hints...
> >> Did you try to set ImpersonationLevel.Impersonate, this is the default
on
> >> W2K and higher but not on NT4.
> >> Did you try using wbemtest.exe to diagnose the problems source?
> >> In your original post you said none of the machines are domain members,
> > why
> >> did you specify the Authority?
> >> Can you put your Start method in a try/catch block to make sure the
> >> exception is thrown by Start.
> >>
> >> Willy.
> >>
> >> "Manfred Braun" <aa@bb.cc> wrote in message
> >> news:eYVanzLIEHA.3040@TK2MSFTNGP09.phx.gbl...
> >> > Hi Willy and All,
> >> >
> >> > ok, I striped the code down to a functional minimum, here it is:
> >> >
> >> >
> >> > //ProbDemoTest.cs
> >> >
> >> > using System;
> >> > using System.Management;
> >> >
> >> > public class ProbDemo
> >> > {
> >> > public static void Main()
> >> > {
> >> >  ManagementEventWatcher watcher;
> >> >  ConnectionOptions co;
> >> >  ManagementPath mp;
> >> >  ManagementScope ms;
> >> >  WqlEventQuery weq;
> >> >
> >> >  co = new ConnectionOptions();
> >> >  co.Timeout = new TimeSpan(0, 0, 60);
> >> >  co.EnablePrivileges = true;
> >> >  co.Authority = "NTLMDOMAIN:x100";
> >> >  co.Username = "tester";
> >> >  co.Password = "abc";
> >> >
> >> >  mp = new ManagementPath();
> >> >  mp.NamespacePath = @"\root\cimv2";
> >> >  mp.Server = "x100";
> >> >  ms = new ManagementScope(mp, co);
> >> >  weq = new WqlEventQuery("select * from __InstanceCreationEvent where
> >> > TargetInstance isa 'Win32_NTLogEvent'");
> >> >  watcher = new ManagementEventWatcher(ms, weq);
> >> >  watcher.EventArrived += new
> > EventArrivedEventHandler(ProbDemo.OnMessage);
> >> >  watcher.Start(); //ERROR
> >> >
> >> >  Console.WriteLine("Press enter to finish querying...");
> >> >  Console.ReadLine();
> >> > }
> >> >
> >> > public static void OnMessage(object sender, EventArrivedEventArgs e)
> >> > {
> >> >  Console.WriteLine("Event, event...");
> >> >  ManagementBaseObject mbo =
> >> > (ManagementBaseObject)e.NewEvent["TargetInstance"];
> >> >  string msg = ((string) mbo["Message"]).Trim();
> >> >  Console.WriteLine(msg);
> >> > }
> >> >
> >> > }
> >> >
> >> >
> >> > Luckily [???], this small version has the same error-behavior ....
> >> >
> >> > Thanks so far and
> >> > best regards,
> >> > Manfred
> >> >
> >> >
> >> > "Willy Denoyette [MVP]" <willy.denoyette@pandora.be> wrote in message
> >> > news:Owi%23QYKIEHA.1048@TK2MSFTNGP12.phx.gbl...
> >> >> Please post a complete sample that illustrates the problem, whithout
> > any
> >> >> code it's hard to tell what's the cause of such an exception.
> >> >>
> >> >> Willy.
> >> >>
> >> >> "Manfred Braun" <aa@bb.cc> wrote in message
> >> >> news:%23ta73rJIEHA.1220@tk2msftngp13.phx.gbl...
> >> >> > Hi All,
> >> >> >
> >> >> > I am writing on a small tool in C#, which creates a
> >> > ManagementEventWatcher
> >> >> > to receives events from a remote machine. Astoundingly, this
behaves
> >> >> > different between different OS. It works fine, if the exe runs on
> >> > Windows
> >> >> > 2000 and connects to NT4 or XP, but it cannot connect to other
> > Windows
> >> >> > 2000
> >> >> > machines. If the exe runs on XP, it can connect to Windows 2000
and
> >> >> > othe
> >> >> > machines as well.
> >> >> >
> >> >> > I get the error in the subject line, with text "Not enough storage
> >> >> > is
> >> >> > available to complete this operation."
> >> >> >
> >> >> > All effected boxes have about 200 MB free memory [and not sure,
that
> >> >> > "sorage", form the error-message, means memory] ;-)  and I am
sure,
> >> >> > it's
> >> > a
> >> >> > securiry issue. I compared the DCOM settings and they are the same
> > for
> >> > all
> >> >> > tested computers [again, which are NT4, XP and Windows 2000]. None
> >> >> > of
> >> > this
> >> >> > test-machines is member of any domain and I specify explicitely
> >> >> > username
> >> >> > and
> >> >> > password, which are valid on the remote computer and work fine for
> >> >> > other
> >> >> > methods [DirectoryEntry, specifying credentials and this
works!!!!!,
> >> > even
> >> >> > for Windows 2000!!!].
> >> >> >
> >> >> > I made some tests to vary my connection-settings for the Windows
> >> >> > 2000
> >> >> > machine and also tried to explicitely set ImpersonationLevel and
> >> >> > Authentication in code, without any success.
> >> >> >
> >> >> > Any help would be really very welcomed, I am out of hope!
> >> >> >
> >> >> > Best regards,
> >> >> > Manfred Braun
> >> >> >
> >> >> > (Private)
> >> >> > Mannheim
> >> >> > Germany
> >> >> >
> >> >> > mailto:_manfred.braun_@manfbraun.de
> >> >> > (Remove the anti-spam-underscore to mail me!)
> >> >> >
> >> >> >
> >> >> >
> >> >>
> >> >>
> >> >
> >> >
> >>
> >>
> >
> >
>
>


Relevant Pages

  • Re: Programming in standard c
    ... read into memory*. ... If you can actually specify the mode, in many cases the size will be ... It's at least two distinct sizes already. ... such accesses with mandatory file locking. ...
    (comp.lang.c)
  • Re: Probleme mit FoxPro Anwendung auf Windows 2003 Terminalserver
    ... Specifies the maximum buffer memory size in bytes. ... for nBuffMemSize that is less than 256K bytes, ... Specify 0 for nBuffMemSize to return the buffer ...
    (microsoft.public.de.fox)
  • Re: 74HCU04 LC Osc
    ... This triggered a 15+ year old memory... ... I have played with your circuit in LTSpice but I cannot reproduce your ... Trise, Tfall, Tdelay of the inverter has a large effect. ... data sheet to specify those items and then adjusted them to get your values. ...
    (sci.electronics.design)
  • Re: Right to specify what personal data is stored?
    ... Do we have a right to specify to companies what personal data of ... The DPA does restrict what can be done with the stored data. ... >companies is that some do not make it clear if they will store your ... >First off, am I able to request, without cost, that companies disclose ...
    (uk.legal)
  • Re: Hawkins ideas on building AIs
    ... >> built a computer system with a very fast memory, ... >> to specify the basic operations to occur in the different levels. ... I was talking about a hierarchy where you ... comparison-projection algorithm works in more detail? ...
    (sci.cognitive)