Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP bug - SetAll increases memory usage
Message
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00521269
Message ID:
00521545
Views:
16
>Nadya,
>
>I have a couple of problems with the code you posted. Mostly it doesn't really isolate the memory usage to the SetAll, in that test the memory can have easily been disappearing in the WAIT WINDOW, the ltrim(), the str() and/or the sys() calls.
>
>This code more specifically isolates only the SetAll:
>
>
Local i, cOldValue, cEndValue
>
>cOldValue = sys(1016)
>
>For i = 1 To 1500 && 000
>    ThisForm.SetAll("ToolTipText", "Test memory", 'Textbox')
>Next
>
>cEndValue = sys(1016)
>
>activate screen
>? "Used memory before SetAll: " + cOldValue + " Now: " + cEndValue
>
>Now running this test I see memory usage increasing by 90k per execution VFP6 SP3. But There are still other possible places that need to be tested. Is it the SetAll itself or the ToolTipText that's causing the problem?
>
>
Local i, cOldValue, cEndValue
>
>cOldValue = sys(1016)
>
>For i = 1 To 1500 && 000
>    ThisForm.SetAll("backcolor", i, 'Textbox')
>Next
>
>cEndValue = sys(1016)
>
>activate screen
>
>? "Used memory before SetAll backcolor: " + cOldValue + " Now: " + cEndValue
>
>This test shows that SetAll() working on the BackColor property doesn't so any increase in memory use when run repeatedly.
>
>So does manipulating the ToolTipText cause the problem?
>
>
Local i, cOldValue, cEndValue
>
>cOldValue = sys(1016)
>
>For i = 1 To 1500 && 000
>   for each loObject in this.Objects
>      if ( loObject.BaseClass = 'textbox' )
>         loObject.ToolTipText = "Test memory"
>      endif
>   endfor
>Next
>
>cEndValue = sys(1016)
>
>activate screen
>
>? "Used memory before foreach: " + cOldValue + " Now: " + cEndValue
>
>This also doesn't show a significant memory increase. It actually shows a small memory usage decrease in a couple of runs. Although it's much slower than SetAll()
>
>Bottomline on these kinds of tests care must be taken to ensure that the code is indeed testing what you think it's testing. FWIW I do not see the increased memory usage in the VFP7 beta.

This is what I wanted to know, since I don't have VFP7 to try. I agree, the problem should be isolated to the actual cause, I just haven't tested it too much. I read article, tried to reproduce, that's all. I tested with and without set status bar, _VFP.AutoYield and wait window and see memory increase in all tests. I didn't try other properties than ToolTipText (I suppose, StatusBarText or comment would behave the same way, but need to test)
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform