JDECOMCONNECTOR2.exe taking alot of memory

hiikaru

Member
Help, developing a vb.net web application. When there are alot people accessing the web, the JDECOMCONNECTOR service seems to slowly taking up alot of memory.

Any idea to solve it?

Thanks in advance.
 
ensure you are calling Dispose() on the RCW wrapper around the JDE Com object when you are finished with it. If you are using .NET 2.0 you should investigate the "Using" syntax to ensure you are disposing of the object as soon as it goes out of scope.

If you are certain you are releasing all your resources against the object but it still seems to have a memory leak, you could try using System.Runtime.InteropServices.Marshal.Release to explicitly call the COM Release method.
 
Big chief,

If mine is a web application and when alot of user log in and log out, will this memory leakage actually happens?

I will try ur method.

Thanks in advance.
 
Hi Hiikaru,
it will depend on the COM object itself. I don't know what your experience of classic COM is, so forgive me if this is obvious to you: When you create a COM object, COM implements reference counting via IUnknown.AddRef and IUnknown.Release. Now, in .NET when you import a COM object the wrapper generated for you will generally take care of this for you - however, Release is not called until finalization time, which is indeterminate and depends on when the GC decides to clear up the unused object. It is for this reason that you must call .Dispose() on the .NET reference when you have finished with it to clear up unmanaged resources otherwise the COM references will hang around in memory, as I say, indeterminately.

I don't know the amount of memory that JDECOMCONNECTOR.exe takes up but if it's a lot you may want to consider implementing some kind of simple pooling. You will only be able to determine if this is necessary by trial and error.

I would go with calling Dispose as soon as you are done, and if there is a lot of throughput that causes a bottleneck, reevalute how you implement the interop.

Hope that helps.

Cheers
 
Back
Top