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: " + cEndValueNow 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: " + cEndValueThis test shows that SetAll() working on the BackColor property doesn't so any increase in memory use when run repeatedly.
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: " + cEndValueThis 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()
>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))