Matthew Lamari | 21 Jul 2007 01:51
Picon

Possible memory leak - LW/ODBC/Win32/Microsoft SQL Server 2K5

I am using CL 3.8.5 (uffi-1.5.18) on Lispworks 5/Win32 to connect to a
Microsoft SQL Server 2K5 database.

I connect with:
(connect (list nil nil nil :connection-string "Driver={SQL
Server};Server=MyServer;Database=MyDB;Uid=myuser;Pwd=MyPassword;")
:if-exists :new :database-type :odbc )

And run a query test with:
(loop for i from 1 to 1000000 do (query "select CAST('hello' as
varchar(4096))"))

This loop basically starts eating up ram from the process.  What is of
interest is that if I break out and GC, (room t) does not indicate any
rise in memory usage, implying that the ram is being eaten up in
foreign allocations?

Eventually, it runs to Lispwork's 1.5G limit and fails with:
Error: Failed to allocate foreign object of size 4002 [allocator STATIC]
  1 (abort) Return to level 0.
  2 Return to top loop level 0.

Disconnect doesn't clean it up either.

Where should I go about tracking down this leak?

I realize that it is plausible that the leak may be at the driver
level or UFFI, not necessarily CLSQL.  However, I was wondering if
this is something that is a known issue for some aspect of the
platform I'm using, or if this is something that devs versed in CLSQL
(Continue reading)


Gmane