BUG: VBS 2.0 String Formatting Functions Leak Memory

Last reviewed: July 16, 1997
Article ID: Q171365
The information in this article applies to:
  • Microsoft Visual Basic, Scripting Edition, version 2.0
  • Microsoft Active Server Pages, versions 1.0, 1.0b

SYMPTOMS

Applications that use the Visual Basic Scripting (VBS) version 2.0 string formatting functions, such as FormatNumber and FormatCurrency, may experience memory leaks. The increased resource usage caused by these memory leaks is particularly important when VBS is used in the Active Server Pages (ASP) environment due to the high volume nature of Web servers.

CAUSE

There are known code defects in the following VBS 2.0 functions, which promote resource leaks:

  • Filter
  • FormatCurrency
  • FormatDateTime
  • FormatNumber
  • FormatPercent
  • Replace

RESOLUTION

In VBS version 2.0, there are two workarounds for this problem:

Avoid using these functions, especially in high-volume environments such as ASP.

-or-

Create your own string formatting functions to replace those provided by VBS. In the case of ASP, this would best be done by creating a server-side component (COM object) that exposes the appropriate formatting methods.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.


Keywords : AXSFVBS
Technology : kbInetDev
Version : 1.0 1.0b 2.0
Platform : NT WINDOWS
Issue type : kbbug


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: July 16, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.