PRB: Memory Leak Passing Arrays from VBScript to VFP (193724)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 6.0
This article was previously published under Q193724 SYMPTOMS
When passing an array from VBScript code to a Visual FoxPro Component
Object Model (COM) Server, memory usage increases.
CAUSE
For every STRING or UNITIALIZED array element, you lose one handle and 8
bytes of memory.
RESOLUTION
The following workaround initializes all elements of the array with numeric
data or Null before sending it to the COM Server.
<%@ LANGUAGE=VBScript ENABLESESSIONSTATE=False %>
<html>
<body>
<p><b>This is a test</b></p>
<%
dim myarray(30)
for i = 0 to 29
myarray(i) = 0 'Or Null
next
set ox = Server.CreateObject("arrayhandler.arrayhandler")
response.write ox.myeval("'<br>'+vers(1)+'</br><br> '+time()+" + _
"' </br>'")
response.write ox.myeval("'<br>UserMem:'+sys(1016) + '</br>'")
ox.DoNothingToArray myarray
set myarray(2) = NOTHING
set myarray(0) = NOTHING
set myarray(1) = NOTHING
set ox = NOTHING
set zzz = NOTHING
%>
</body>
</html>
STATUS
Microsoft is researching this problem and will post new information here in
the Microsoft Knowledge Base as it becomes available.
Modification Type: | Major | Last Reviewed: | 7/1/1999 |
---|
Keywords: | kbprb KB193724 |
---|
|