Microsoft KB Archive/187642

= "Out of Memory" Calling COMTI in Same MTS Package as Caller =

Article ID: 187642

Article Last Modified on 3/12/2004

-

APPLIES TO


 * Microsoft COM Transaction Integrator for CICS and IMS 1.0 SP1, when used with:
 * Microsoft SNA Server 4.0 Service Pack 1

-



This article was previously published under Q187642



SYMPTOMS
An "Out of Memory" error occurs when one component installed in a Microsoft Transaction Server (MTS) package invokes a method of a COM Transaction Integrator for CICS and IMS (COMTI) component installed in the same MTS package. The error occurs in the COMTI component. The following conditions are met:

 A COMTI component is called from another MTS component. Both components are installed in the same MTS package. The COMTI method being called has a return value.  Both components share MTS Object Context, for example: Set oComTI = GetObjectConext.CreateInstance("MyCOMTI.MyMethod") 



CAUSE
The pointer to the return value data is not properly initialized in the COMTI runtime. This causes an attempt to free memory (that has not been acquired) before handling the return value of the reply data from the host. Thus, the COMTI component sends an Access Violation exception, which MTS receives. Therefore, MTS destroys the hosting process (Mtx.exe). This causes a failed method call and eventually an "Out Of Memory" error to be returned to the caller.



WORKAROUND
To work around this problem, do one of the following:


 * Put the COMTI component in a different MTS package from the calling component. This causes a marshal to occur, and the marshaling code initializes pointers to all parameters (including return values).
 * Do not share MTS Object Context. This causes the COMTI component to be created on a different thread. Therefore, a thread marshal occurs and yields similar results to the first workaround.
 * Do not use a return value for the COMTI method; instead make the desired return value an output parameter, which avoids the problem.



STATUS
Microsoft has confirmed this to be a problem in Microsoft COM Transaction Integrator for CICS and IMS version 1.0 SP1, included with SNA Server version 4.0 SP1. A supported fix is now available, but has not been fully regression- tested and should be applied only to systems experiencing this specific problem. Unless you are severely impacted by this specific problem, Microsoft recommends that you wait for the next Service Pack that contains this fix. Contact Microsoft Product Support Services for more information.

Keywords: kbbug kbfix KB187642

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.