PC MAPI: Loss of Memory with MapiSendMail and Visual Basic

Last reviewed: August 26, 1996
Article ID: Q148369
The information in this article applies to:
  • Microsoft Mail for Windows, version 3.5

SYMPTOMS

When the MAPI function MAPISendMail is used in an application developed with Microsoft Visual Basic versions 2.0 and 3.0 for Windows, the memory is not released properly from the global heap. When you exit the MAPI application, it will release the memory.

If the application sends large numbers of messages or several messages with multiple recipients the heap memory could be exhausted and result in subsequent failures of applications running in the Microsoft Windows environment.

When the MAPI application is stopped, the memory that was not released during operation will be released and become available to other applications.

The amount of memory lost during the MAPISendMail function call will be on the order of 32 bytes for each recipient and 32 bytes for each attached file. If the Windows system has a few megabytes of available memory, it will take thousands of messages to exhaust the heap. This is a problem only for a program designed to run for long continuous periods.

CAUSE

The loss of heap memory is a result of an error in MAPI.DLL and the way it frees allocated memory. The memory fails to be released for each recipient and for each attached file in the message. This loss only occurs when the Visual Basic MAPI interface is used. It does not occur if the application uses the MAPI interface for Microsoft C.

STATUS

Microsoft has confirmed this to be a problem in version 3.5 of Microsoft Mail for Windows. A fix for this problem is in development, but has not been regression-tested and may be destabilizing in production environments.

Contact Microsoft Product Support Services for more information on the availability of this fix. \\cypress\qferel\hotfixes\clients\win&pm\mapi.dll\v3.05.4095


Additional reference words: 3.00 3.20 3.20a 3.50
KBCategory: kbprg kbtool
KBSubcategory: MailPCMAPI


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: August 26, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.