Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

db.sqlite keeps growing forever.. up to 18 Gig! #2893

Closed
jpage4500 opened this issue May 21, 2024 · 2 comments
Closed

db.sqlite keeps growing forever.. up to 18 Gig! #2893

jpage4500 opened this issue May 21, 2024 · 2 comments

Comments

@jpage4500
Copy link

This isn't a new issue AFAIK -- I commented on this one a while back: #62

I wrote a test Android app using TDLIB which isn't much more than a simple Telegram client. I had kind of forgotten about it until my test device was running low on space and found out this was the culprit.

sargo:/data/data/com.test.app/files/telegram # ls -al
...
-rw-------  1 u0_a235 u0_a235 18727751680 2024-05-21 10:42 db.sqlite
-rw-------  1 u0_a235 u0_a235      229376 2024-05-21 10:42 db.sqlite-shm
-rw-------  1 u0_a235 u0_a235  2529132072 2024-05-21 10:42 db.sqlite-wal
...

Is there some way to clean this periodically? I imagine it's just accumulating every message for every channel I'm subscribed to and never removing them. I don't see a TDLIB function to do this. I do see OptimizeStorage but that appears to be for the attachments it's downloading and not related to the database

@levlam
Copy link
Contributor

levlam commented May 21, 2024

If you don't have secret chats, and don't store important data in chat.client_data, then you can just delete the db.sqlite file when the TDLib instance is closed.

@levlam
Copy link
Contributor

levlam commented Jun 3, 2024

You can also disable all databases in setTdlibParameters, in which case the database will be deleted and wouldn't be used anymore.

@levlam levlam closed this as completed Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants