Hi,
 
I am a new user so please make allowances accordingly.
 
Using SQLite3 3.5.9, I am seeing a consistent rise in memory with each call to 
sqlite3_step().
 
My code pattern to store a 14830 byte buffer is:
 
A. mem = sqlite3_memory_used();
sqlite3_prepare_v2(.......
B. mem = sqlite3_memory_used();
sqlite3_bind_blob(..,..,..SQLITE_STATIC);
C. mem = sqlite3_memory_used();
sqlite3_step(..
D. mem = sqlite3_memory_used();
sqlite3_finalize(
E. mem = sqlite3_memory_used();
 
This sequence of calls is repeated on the same connection and ignoring the 
first run, the memory stat returned at each stage indicates a loss of 17460 
bytes. The values for the second and third runs are:
 
A. 32588  50048
B  34533  51993
C. 34533  51993
D. 67059  84519
E. 50048  67508
 
Calling sqlite3_bind_blob() with SQLITE_TRANSIENT causes as extra malloc but 
the end result is the same - i.e. a memory loss of 17460 bytes.  
 
A. 32588  50048
B. 34533  51993
C. 49363  66823
D. 81889  99349
E. 50048  67508
 
  
However. if I comment out the call to sqlite3_step() then I do not see any 
memory loss either with SQLITE_STATIC or SQLITE_TRANSIENT.
 
This is basic functionality so I am doing something wrong. The docs thoough do 
not throw any light on the matter.
 
Any help or guidance is greatly appreciated.
 
Regards,
 
John D.
 
_________________________________________________________________
What can you do with the new Windows Live? Find out
http://www.microsoft.com/windows/windowslive/default.aspx
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to