I seem to get a memory leak from COM+, and will really appreciate ANY
pointers. I get it even with the extremely simple piece of code included
below:
I do a call to a com+ class. This class intantiates an instance of
another COM+ class (in my code sample, anoher instance of itself, but can
be any other configured COM+ class) Note in the code : I don�t even use
this class, just create an instance. I then call setcomplete, dispose the
object and return control. Task manager reports that with each call to
this COM+ object the memory increases with 6 k. I need to run a big batch
job, with millions of iterations. The memory usage of the application
starts at about 30 mb, but slowly increases to about 650 mb, when COM+
gives an out of memory exception.I get this when using DCOM as the
transport to COM+ or when using remoting with SOAP and IIS.
* COM+ class
<Transaction(TransactionOption.Required), EventTrackingEnabled(True)> _
Public Class clsCOMPlusTester
Inherits ServicedComponent
Public Function Test()
Dim lobjX As New clsCOMPlusTester
ContextUtil.SetComplete()
lobjX.Dispose()
End Function
End Class
* Calling Code
Dim lint As Integer
Dim lobjBO As New TestBenchHelper.clsCOMPlusTester
For lint = 1 To 100000
lobjBO.Test
Next
Note: One interesting difference between using DCOM and IIS: When leaving
out the lobjx.dispose call shown in the code on the COM+ object the
following happens: Using DCOM, it eats memory. If you have a look at the
serviced component manager, it shows MANY objects with only 1 activated.
When using IIS, this does not happen: the remoting process to IIS must
pick up �orphaned� com+ objects and garbage collect them. Basically
under IIS the memory leak is slow regardless of wheter you dispose or not,
while under DCOM you can eat memory fast of slow.
I have played around with multiple different scenarios etc., but still get
exactly the same results. I�ve been hoping to sort this out, but are
nearing the project deadline and I am URGENTLY looking for answers
Regards
JC Oberholzer
JC Oberholzer
SDT Financial Software Solutions (Pty) Ltd
Phone +27(0)12-347
4945
Fax +27(0)12-347
4946
Visit us at
www.sdt.co.za
===================================
This list is hosted by DevelopMentor� http://www.develop.com
NEW! ASP.NET courses you may be interested in:
2 Days of ASP.NET, 29 Sept 2003, in Redmond
http://www.develop.com/courses/2daspdotnet
Guerrilla ASP.NET, 13 Oct 2003, in Boston
http://www.develop.com/courses/gaspdotnet
View archives and manage your subscription(s) at http://discuss.develop.com