SQLite Forum

Clear shared memory DB and backup problem
"I assume that should be no memory increase because I backup again same data."

Your assumption is wrong. What you are seeing is called "fragmentation". This is characteristic of every storage scheme for variable size objects in spaces of fixed capacity, even for the stuff in your garage.

The space used will increase more and more slowly until a balance point is reached, where "deleted" space ist being re-used at the same rate as it is being created. This is charaterized by the increase of space usage declining over iterations. I.e. asymptotic space usage.

A true leak would manifest itself in a constant increase of space usage for each iteration. I.e. linear space usage