Adding the right alias...
I have following C program
It takes the DB path as argument
For testing, I have placed the DB on a dir over the NFS
Now after the open call, I unshare the NFS from the NFS server to generate I/O
errors
Once the exec starts receiving errors, it is leaking memory.. after 6 hours,
its leaking upto 1G
I'm using version 3.3.9 and I see the same with version 3.6.23
Any help will be appreciated!
thanks,
-vikrant
---prstat for vmem---
PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
8548 root 15M 10M cpu0 0 0 0:00:44 33% vmem/1
Total: 1 processes, 1 lwps, load averages: 0.59, 0.59, 0.40
PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
8548 root 15M 10M cpu1 0 0 0:00:47 34% vmem/1
Total: 1 processes, 1 lwps, load averages: 0.60, 0.60, 0.40
PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
....
PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
8548 root 1130M 1123M cpu0 0 0 2:53:12 50% vmem/1
Total: 1 processes, 1 lwps, load averages: 1.06, 1.05, 1.05
PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
8548 root 1130M 1123M cpu0 0 0 2:53:17 50% vmem/1
Total: 1 processes, 1 lwps, load averages: 1.05, 1.05, 1.05
-----vmem.c------
#include<stdio.h>
#include <string.h>
#include <pthread.h>
#include <signal.h>
#include <errno.h>
#include <dirent.h>
#include <sqlite3.h>
cbproc(void *iotemp,
int argc,
char **argv,
char **colname)
{
return 0;
}
int main(int argc, char* argv[])
{
char dbpath[1024];
void* hdb;
int i,j,k;
char sqlcmd[1024];
char *errmsg = (char *) NULL;
int ret;
sprintf(sqlcmd, "select * from iotemp ");
strcpy(dbpath, argv[1]);
for(i=0;i<1;i++) {
ret = sqlite3_open(dbpath, (sqlite3 **) &hdb);
fprintf(stdout, "sqlite3_exec: return value = (%d)\n", ret);
if(ret) {
fprintf(stderr, "sqlite3_open Error errno=(%d)", errno );
}
fprintf(stdout, "Sleeping for 50 sec\n");
sleep(50);
fprintf(stdout, "Sleeping DONE for 50 sec\n");
while(1) {
ret = sqlite3_exec((sqlite3 *) hdb, sqlcmd, cbproc, NULL, &errmsg );
fprintf(stdout, "sqlite3_exec: return value = (%d)\n", ret);
if(ret) {
fprintf(stderr, "sqlite3_exec Error errno=(%d) (%s)", errno, errmsg);
} else {
fprintf(stdout, "sqlite3_exec OK \n");
}
}
}
return 0;
}
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users