Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP bug - SetAll increases memory usage
Message
From
20/06/2001 01:29:23
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00521269
Message ID:
00521282
Views:
18
>Hi everybody,
>
>I'm reading an interesting Russian VFP site right now: www.nsvisual.com.fox2
>
>and here I found a problem, which I just reproduced:
>
>Create a form with several textboxes and a command button. Put this code in command button click event:
>
>Local i, cOldValue
>cOldValue = sys(1016)
>* Than the string passed to SetAll is longer, than the effect is more noticable
>
>For i = 1 To 1500000
>    ThisForm.SetAll("ToolTipText", "Test memory", 'Textbox')
>    wait window Ltrim(str(i)) + " - " + sys(1016) nowait
>Next
>messagebox("Used memory before SetAll: " + cOldValue + " Now: " + sys(1016))
>
>I'm curious, was this problem fixed?
>
>Thanks in advance.

Hi Naday,
Which problem do you mean?
The altering of SYS(1016) within the loop,
The increased number of SYS(1016) in the loop compared to cOldVal
or the increased number of SYS(1016) in the messagebox?

Or if You like fun alter the last line to:
?sys(1016)
messagebox("Used memory before SetAll: " + cOldValue + " Now: " + sys(1016)) 
?sys(1016)
My guess is, that 'user defined object' includes the running code. Remember the Fox is an interpreter that needs do interpret line by line and do do that it needs several memory space. The Messagebox as well is defined by running code.
The altering number within the loop may result from the interpreter as well.

The Change is not that big, this is within 100 bytes.

On the other hand ... I rerun the code on the form still opend after entering the lines above (so after 10 minutes) and the numbers change again. And now from 391644 Start value to something 4016?? start value. This is more significant. The space occupied increases with waitng time. Oh- Oh.

May be I have to look for a better virus scaner or to change the language ...

By
Lutz
Previous
Reply
Map
View

Click here to load this message in the networking platform