PRB: Memory Leak in Active Messaging v1.1 Folder Handling Proces

Last reviewed: November 21, 1997
Article ID: Q171427
The information in this article applies to:
  • Collaboration Data Objects (CDO), version 1.1

SYMPTOMS

There is a reproducible 4k memory leak in the Active Messaging version 1.1 folder handling process.

RESOLUTION

The only available workaround at this time is to periodically shutdown the process that is slowly consuming available memory.

STATUS

Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce the Behavior

The following code sample from a Visual Basic 5 Form will reproduce this leak. The leak can be monitored in the Windows NT Performance Monitor, or in the Windows NT Task Manager.

   Private Sub Command1_Click()
      For i = 1 To 200 Step 1
         'Update counter on form to show progress
         Text1.Text = i
         Text1.Refresh

         'Dim objects, then create and logon to session
         Dim objSession As Object
         Dim objMsg As Object
         Set objSession = CreateObject("MAPI.Session")
         objSession.Logon "MyProfileName", "", False

         'With the following line commented leak does not occur
         Set objMsg = objSession.Inbox.Messages.GetFirst

         'Cleanup and logoff
         Set objMsg = Nothing
         objSession.Logoff
         Set objSession = Nothing
      Next i
   End Sub

   Private Sub Command2_Click()
      Unload Me
   End Sub

To monitor this in the Performance Monitor:

  1. Place the above code in a Visual Basic 5 form with two command buttons and a text box, then run the form.

  2. Click on the "+" symbol in the toolbar.

  3. In the Object dropdown, select "Process."

  4. In the Instance list box, select Visual Basic.

  5. In the Counter list box, select "Private Bytes" then choose Add on the far right.

  6. Also in the Counter list box, select "Virtual Bytes" then choose Add again.

Over a period of time you will be able to note that while Private Bytes is remaining relatively stable, the Virtual Bytes will be on a slow but steady increase until the system has no available memory left to provide to the process.

The only way to recover the lost memory is to shutdown the process.

REFERENCES

For additional information about Collaboration Data Objects versus Active Messaging, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q176916
   TITLE     : INFO: Active Messaging and Collaboration Data Objects (CDO)

Keywords          : kbcode ActMsg
Version           : WINDOWS:1.1
Platform          : WINDOWS
Issue type        : kbprb


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 21, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.