Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MTS memory leak?

Status
Not open for further replies.

jonelf

Programmer
Feb 21, 2001
22
0
0
SE
Hi,

We are developing a n-tier solution with IIS/ASP, MTS and Oracle. We are using VB components in the MTS that are accessing the datbase with ADO / Oracle OLE DB.
In the test case we have to methods in the the same object. If we access any one of the methods from the ASP-page we have no problem. If we access both of them the rpcss.exe and mtx.exe process grows forever.
ASP-file-1
set obj=server.createobject("our_component")
obj.gethtml(id)
set obj=nothing
---
runs fine for hours hammered by Web Application Stress Tool.
---
ASP.file-2
set obj=server.createobject("our_component")
obj.getmetatags(id)
set obj=nothing
---
also runs fine for hours hammered by Web Application Stress Tool.
---
ASP.file-3
set obj=server.createobject("our_component")
obj.gethtml(id)
obj.getmetatags(id)
set obj=nothing
---
The mtx.exe and rpcss.exe grows until the application stops.
Even if we:
ASP-file-4
set obj=server.createobject("our_component")
obj.gethtml(id)
set obj=nothing
set obj=server.createobject("our_component")
obj.getmetatags(id)
set obj=nothing
---
The problem still occours. The mtx.exe and rpcss.exe grows.

Our solutions is in some respects based on FMStocks.

We are running WinNT4.0SP6a, hotfix Q265433, MDAC 2.60.6526.3, Oracle OLE DB 8.1.7.10.

Any ideas are welcome!

/J
 
It turned out to be the Oracle OLE DB prodider that was leaking. See thread333-58616 problem isn't solved but now we at least know what the problem is...
 
Hi,

We have memory leaks in a component running under MTS. This is the mail that I posted in the Microsoft MTS programming mailgroup.

----->
We have created a MTS component that is used by about 80 users to access a
SQL database. Every two days or so, the MTS server process (mtx.exe)
consumes so much memory that it needs to be killed.

After carefull examination of our code, we tried to isolate the memory-leak
problem and we have narrowed it down to this extremely simple example.

All code is created in VB5 and is running under Windows NT4 SP3 and MTS 2.0
on a 256 MB Pentium 2 machine.

First we have created an ApartmentThreaded ActiveX DLL named: MTSTestLib.
This project has one MultiUse class named:BusObject consisting of the
following code:

Option Explicit

Public Function Test(ByVal lCall As Long) As Long
' just increment lCall to show we are
' actually doing something
Test = lCall + 1
' let transaction complete
GetObjectContext.SetComplete
End Function

This project is compiled and the DLL is added to a package named MTSLib. The
Component is added to this package and it the BusObject is set to require a
transaction.

Next we created a simple test program to test this MTS component, it is a
simple form with a button and a label on it:

Option Explicit

Private Sub cmdGo_Click()
Dim lCalls As Long
Dim BusObject As BusObject

On Error GoTo ErrorHandler
lCalls = 0
Do
Set BusObject = CreateObject("MTSTestLib.BusObject")
lCalls = BusObject.Test(lCalls)
' release BusObject
Set BusObject = Nothing
lblCalls.Caption = CStr(lCalls)
DoEvents
Loop
Exit Sub

ErrorHandler:
MsgBox "Error in CmdGo_Click " & Err.Description
End Sub

Next, we run this and open performance monitor and add a Process counter
that watches the Working Set of the mtx.exe process (in fact there are two
such processes but only one will change in time when we run our example).
After some time we see a 'sawtooth' like chart,but one that is slowly eating
up memory ( the Minimum and Maximum number of bytes gradually increase).

Now the big question is:

a) is there something wrong with our code?
b) is this a genuine MTS memory leak and if so, can anybody come up with a workaround?

<----

Running this example during the weekend, crashed the MTS component with an out of memory error.


 
There are alot of known issues with NT4SP3. I recommend that you upgrade to VB6 (with latest Visual Studio SP) and to NT4SP6a (or later if available).

Our problem actually turned out to be in the Oracle OLE DB provider. Oracle are working on a solution.

/J
 
I know about the issues involved wih SP3 and VB5 but this has the same result in VB6 and SP6. (Our production environment (which is quite large) prevents us from upgrading at this point. However, did you notice the extreme simplicity of the program? It looks like that calling GetObjectContext.Setcomplete is responsible for a memeory leak when MTS is under extreme stress. This bothers me very much. If, and only if this is true, than any MTS component that runs under these conditions should show this memeory leak.

Laurens
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top