stephencelis / SQLite.swift

A type-safe, Swift-language layer over SQLite3.
MIT License
9.75k stars 1.57k forks source link

Possible Memory Leak #1162

Open lczvd opened 2 years ago

lczvd commented 2 years ago

Hi,

I just noticed something on version 0.13.3.

The Xcode Instruments is reporting the following leak:

leak

By the way, I'm using Xcode 14.0.1 and the app is running on iOS 14.6.

Any ideas on the possible source of this issue?

Thanks in advance!

jberkel commented 2 years ago

In the screenshot it looks like the allocation is happening inside SQLCipher, though? Maybe your app is leaking connections.

nathanfallet commented 2 years ago

More information is required. Can you provide a reproducible example?

davifmarcelino commented 1 year ago

Hi, I have the same issue so I will give you guys the stack trace of 3 sqlcipher_mem_malloc leak in the project

AllLeaks

the first leak

Leak_1

the second leak

Leak_2-1 Leak_2-2

and the last leak

Leak_3-1 Captura de Tela 2023-01-19 às 2 22 42 PM
raulperesgoes commented 1 year ago

Do you need more info to work on that? Is there any other way we could help you?

GuillaumeUnice commented 4 months ago

I encounter the exact same problem... any improvement?

sinhpn92 commented 3 months ago

Did you resolve this issue @raulperesgoes ? @GuillaumeUnice

GuillaumeUnice commented 3 months ago

Yes on my side it was due to the fact I open the database again at each SQL query and behind the hood is using a custom malloc in C and I never destroy the ref on it as I don't close the previous open DB.

Basically, I wrongly use the lib