This is an old problem that keeps showing it's ugly head. It was corrected
in V1.1 SP1, but apparantly it didn't make it in V2.
I voted on the bug.
Willy.
"Salvador" <Sa******@discussions.microsoft.com> wrote in message
news:3C**********************************@microsof t.com...
| Well, it seems that Microsoft has validated the fault, and there are
another
| users experiencing the same problem.
|
|
http://lab.msdn.microsoft.com/produc...b-f6c2ff903df4
|
| I was right, is very easy to reproduce the error.
|
| --
| Salvador
| Exony Ltd - London, UK
|
|
| "Willy Denoyette [MVP]" wrote:
|
| > I have several queries like this running without experiencing a leak.
With a
| > leak I mean running into out-of-memory exceptions after a certain amount
of
| > time.
| > I don't like the idea of the finalizer (I suppose this is what you meant
| > with finalize section), nor do I know without you posting some code
sample
| > what you mean with "explicitly disposing my object", question is what
| > object.
| > Not sure if you create a single ManagementScope per remote server and
run
| > successive queries against this scope, or whiter you create a new scope
per
| > query (a connection per query).
| >
| > Willy.
| >
| >
| >
| > "Salvador" <Sa******@discussions.microsoft.com> wrote in message
| > news:EB**********************************@microsof t.com...
| > | Hi Willy,
| > |
| > | Thanks for your response. I have used the CLR profiler and the memory
| > | consumption is on the ManagementObjectSearch, especially when I query
the
| > | Load balance WMI classes of the remote machine. (you can query the
load
| > | balance service, cluster service and so on). It is clear that the
memory
| > | consumption is on the WMI components because as soon as I disable the
| > queries
| > | the memory does not grow. I explicitly dispose my object on my finalze
| > | section, but memory is not returned, even if I force a collect on the
| > garbage
| > | collector. You can create a simple to reproduce it:
| > | 1) Create a WMI connection to a remote machine
| > | 2) Create a query, if is the load balance component better otherwise
any
| > | other will reproduce the fail.
| > | 3) Perform a search
| > | 4) Enumerate the content of the returned collection
| > | 5) Dispose the object
| > |
| > | If you only check one machine the growth is very slow, but as my
| > application
| > | queries 35 machines the memory growth is more exposed. If I implement
the
| > | same code in C++ using the COM libraries the fault is not reproduced.
I am
| > | using .NET 1.1 with SP1.
| > |
| > | Before raising it as a fault I wanted to post it here to check if any
| > other
| > | developer experienced this problem. I work for a golden microsoft
partner
| > and
| > | we have raised several bugs before to Microsoft who kindly deliver a
| > special
| > | patch.
| > |
| > | Thanks for your time,
| > | Regards
| > |
| > |
| > | --
| > | Salvador Alvarez Patuel
| > | Exony Ltd - London, UK
| > |
| > | "Willy Denoyette [MVP]" wrote:
| > |
| > | > Please try to identify what memory leak you see, use a memory
profiler
| > like
| > | > the ClrProfiler or the VS2005 profiler. Use the performance monitor
and
| > | > watch the memory (managed and unmanaged counters).
| > | > If possible post a complete sample that illustrates the issue.
| > | > Note that WMI is not implemented in managed code, the
System.Management
| > | > classes are just tiny wrappers around the COM Wbem interfaces, so
don't
| > | > assume the implementation is the culprit, failing to dispose is in
| > general
| > | > the cause of memory growth, but again this isn't necessarily a leak.
A
| > | > memory leak is a BUG, the memory cannot be recovered by any means
other
| > than
| > | > terminating the process.
| > | >
| > | > Willy.
| > | > PS. I don't know what you mean with loadbalanced WMI, there is no
such
| > thing
| > | > I'm aware of, am I missing something.
| > | >
| > | >
| > | > "Salvador" <Sa******@discussions.microsoft.com> wrote in message
| > | > news:C7**********************************@microsof t.com...
| > | > | Hi,
| > | > |
| > | > | I am using WMI to gather information about different computers
(using
| > | > win2K
| > | > | and win 2K3), checking common classes and also WMI load balance.
My
| > | > | application runs every 1 minute and reports the status of the
| > machines.
| > | > |
| > | > | Upon we follow the .NET object lifetime recommendations the
| > application is
| > | > | constantly consuming more memory! The problem is on the
| > | > | ManagementObjectSearch, upon we Dispose the object it seems that
is
| > not
| > | > | releasing the memory.
| > | > |
| > | > | I think is related to the dodgy managed wmi implementation as is
not
| > fully
| > | > | implemented on 1.1 neither 2.0. If you google the problem you can
find
| > | > plenty
| > | > | of people suffering the leak.
| > | > |
| > | > | Microsoft reported that there is a memory leak on the load balance
WMI
| > and
| > | > | its says that affects win2K (solved with the latest service pack),
but
| > it
| > | > | does not help.
| > | > |
| > | > | Any comments?
| > | > |
| > | > | Regards
| > | > |
| > | > |
| > | > |
| > | > | --
| > | > | Salvador Alvarez Patuel
| > | > | Exony Ltd - London, UK
| > | >
| > | >
| > | >
| >
| >
| >