Hi SQLite creators,
for embedded Linux 2.6.35.3 on armV5, I get memory usage not freed at
close(ltib compilation environment).
with this following test ( only one connection to the database ):
1) open database
2) prepare statement
3) SQL request inside begin commit
4) finalize statement
5) close database
6 ) loop to 1 )
the return is SQLITE_OK at each step:
do{
sqlite3_open_v2(...,&db,SQLITE_OPEN_READWRITE,0);
sqlite3_exec(db,"PRAGMA journal_mode = MEMORY",0,0,0);
sqlite3_prepare_v2(db...
sqlite3_step( statement Begin //BEGIN EXCLUSIVE TRANSACTION
sqlite3_reset( statement request
sqlite3_step( statement request
sqlite3_column_int64( statement request
sqlite3_step( statement Commit
sqlite3_finalize(...
sqlite3_close_v2(...
}while
I have got memory usage not freed after the close:
the sqlite3_memory_used()
give 0 before open
give 127376 after the first open
give 133296 after the close
the sqlite3_memory_used()
give 133296 before open
give 260624 after the second open
give 266544 after the close
the sqlite3_memory_used()
give 266544 before open
give 393872 after the third open
give 399792 after the close
/proc/2365/status
Tgid: 2365
Pid: 2365
PPid: 1
TracerPid: 0
Uid: 0 0 0 0
Gid: 0 0 0 0
FDSize: 32
Groups: 0 1 2 3 4 6 10
VmPeak: 3316 kB
VmSize: 3316 kB
VmLck: 0 kB
VmHWM: 2000 kB
VmRSS: 2000 kB
VmData: 964 kB
VmStk: 136 kB
VmExe: 552 kB
VmLib: 1464 kB
VmPTE: 6 kB
VmSwap: 0 kB
Threads: 1
Tgid: 2365
Pid: 2365
PPid: 1
TracerPid: 0
Uid: 0 0 0 0
Gid: 0 0 0 0
FDSize: 32
Groups: 0 1 2 3 4 6 10
VmPeak: 3580 kB
VmSize: 3580 kB
VmLck: 0 kB
VmHWM: 2256 kB
VmRSS: 2256 kB
VmData: 1228 kB
VmStk: 136 kB
VmExe: 552 kB
VmLib: 1464 kB
VmPTE: 6 kB
VmSwap: 0 kB
Threads: 1
inside /proc/2365/fd/ a new file descriptor is added at each open database, but
never deleted at close database.
same behaviour with sqlite 3.9.2 and 3.18.0 ( compiled with -DSQLITE_CORE
-DNDEBUG=1 -DSQLITE_THREADSAFE=2 -DSQLITE_ENABLE_ATOMIC_WRITE
-DSQLITE_DEFAULT_AUTOMATIC_INDEX=0 -DSQLITE_ENABLE_MEMORY_MANAGEMENT
-DSQLITE_TEMP_STORE=3)
Is any workarounds are available to close the database and freed all its
memories allocated by sqlite inside the same application (without restart the
application process)?
Regards,
Stephane
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users