Z
zq
Hi!
I am have a COM object which occupies more and more memory everytime it's
used.
The "VM size" counter (private bytes) of the process that uses the COM
object keeps on growing when instantiating and using the object frequently.
I tried following strategies for using the object:
1. instantiate the object when the app starts, use it frequently (inside an
event handler), and destroy it when the app ends.
2. instantiate the object inside the event handler, and release it every
time the event handler is finished
I tried using System.Marshal.ReleaseCOMObject() by calling it untill it's
result returns zero, but it has no effect.
Once the VM size reaches the pagefile size, the process starts throwing "out
of memory" exceptions if it tries to instantiate other objects (e.g. a
Bitmap object).
I have narrowed-down the problem to the COM object, because if I comment-out
the part where I use the COM object the "VM size" falls from cca 250MB to
1MB once when it's done working (i guess it means all other objects are
properly disposed and GC-ed).
My questions are:
Is there a way to see if there are any dependant COM objects created during
the COM's work?
Is there a way to destroy all dependant COM objects?
Can anybody help me please!
zkeber
I am have a COM object which occupies more and more memory everytime it's
used.
The "VM size" counter (private bytes) of the process that uses the COM
object keeps on growing when instantiating and using the object frequently.
I tried following strategies for using the object:
1. instantiate the object when the app starts, use it frequently (inside an
event handler), and destroy it when the app ends.
2. instantiate the object inside the event handler, and release it every
time the event handler is finished
I tried using System.Marshal.ReleaseCOMObject() by calling it untill it's
result returns zero, but it has no effect.
Once the VM size reaches the pagefile size, the process starts throwing "out
of memory" exceptions if it tries to instantiate other objects (e.g. a
Bitmap object).
I have narrowed-down the problem to the COM object, because if I comment-out
the part where I use the COM object the "VM size" falls from cca 250MB to
1MB once when it's done working (i guess it means all other objects are
properly disposed and GC-ed).
My questions are:
Is there a way to see if there are any dependant COM objects created during
the COM's work?
Is there a way to destroy all dependant COM objects?
Can anybody help me please!
zkeber