Hi, everybody!
I've just found very annoying thing. I'm calling MSSQL stored procedure to get 200 character length value from the server. It's being done inside the loop and I see memory leak - the same 200 bytes per call. The code below, when executed, eats 20M of memory. It can be monitored by Windows Task Manager, and the only way to release memory is quit VFP. Nothing else helps. Here's the code:
local i,lc_test
lc_test=''
h=sqlconnect()
for i=1 to 100000
sqlexec(h,"{call sp_nothing(?@lc_test)}")
endfor
sqldisconnect(h)
And the procedure itself:
CREATE PROCEDURE sp_nothing @par1 varchar(200) OUTPUT
AS
set @par1='01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'
Any ideas?