I am experiencing a memory usage issue while running a simple single-threaded C++ program for long time (say over night). The program uses SQLite3 API to open a data base and writes some data in it within a loop.I am running the program on two different machines: a desktop Ubuntu Linux and an ARM based embedded device running a custom built Linux.
In both cases I am getting the same results: Memory is consumed gradually and not released while application is running. I am checking memory usage using a simple bash script running in background:
do free -m;
char *ErrMsg = 0;
for (int i = 0; i < 1000000; i++)
sprintf(SQL_Statement, "INSERT INTO PointValue (TimeStamp, BlockId, PointId, Value) VALUES (%f, %d, %d, %d);",TimeStamp_ ,BlockId_, PointId_, Value_ );
check = sqlite3_exec(MyDB, SQL_Statement, callback, (void*)data, &ErrMsg);
Thanks everyone for your answers and comments. It is confirmed that The memory is consumed by linux page cache which is fine because Linux hopefully takes care of it and releases unnecessary pages when another application need more memory. just using a simple command: