>>A while back I posted a problem with an intensive-processing app that slowed to a crawl after an hour or so...I've unearthed the apparent culprit. It's SCAN. After thousands of SCANs, the processing nearly dies. I replaced the SCANs with SQL (even with no optimization available) and FORs, and now the app runs for hours without any slowdown whatsoever.
>>
>>I found an old SCAN memory leak bug article for FP for MACs, and this sounds the same except it doesn't show up until a great many SCANs are made in vfp5 & 6.
>
>Just a thought, are you doing a SELECT (scanningTable) just before ENDSCAN, if so - it's not needed and slows it down somewhat - may even be source of leak?
>(grasping at straws :-)
No, it's quite a simple method, though Checkbits has some complex string comparisons:
******************
local ncount
ncount = 0
scan
if thisform.checkbits() != -1
ncount = ncount + 1
endif
endscan
return ncount
******************
I finally made an SQL out of it (including Checkbits), it's quite messy & not optimized, but it runs fast and never has the slowdown problem...it's the only looping that's run a great many times...
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.