Reputation: 3316
I am checking the amount of memory that SQLite operations consume (mostly insert).
I run my program on docker container, and inspect the memory usage with docker stats <container id>
. I observe a weird behavior where the memory usage only grows and doesn't return to normal after the operation has complete.
here is a snippet of the code:
conn = sqlite3.connect(app.config['DATABASE'])
cur = conn.cursor()
cur.execute('insert into users (uid, full_name, email, username, job_title) values (?,?,?,?,?)', [user_cn, user_full_name, user_email, user_uname, user_jobtitle])
conn.commit()
conn.close()
Its only a snippet (I cutted out most of the code), this procedure takes place thousands of times (commit on every insert, close once at the end).
As I said I observe only an increase in the memory usage on stats
, another thing I observed is that top
doesn't show any memory activity (stays 0.1%).
On my research I tried running some dummy operation on the linux:
for i in {1..100000}; do echo "aaaaaaaaaaaaaaaaaaa" >> woot.data; done
I observed the same behavior so I guess it's not SQLite's problem but I still include it since its my usecase and maybe its configuration/connection close related stuff.
Any advice on solving this mystery will be highly appreciated!
EDIT: The docker's version is: Docker version 1.5.0, build a8a31ef/1.5.0
Upvotes: 1
Views: 357
Reputation: 1329002
That can depends on your actual host, and docker version.
For instance:
Upvotes: 1