Hello everyone, I have a problem using sqlite in one of my project. When I create instance of sqlite (sqlite_open) from main thread, memory consumption is in normal (a few megabytes). But when I start sqlite from another thread, immediately around 70 - 80 MB of memory is allocated.
Here is the smallest example, which can reproduce this problem. Link to pastebin where source code is: https://pastebin.com/BkU3uMCb. There is also some more info about memory usage. There are results of memory usage (from proc/pid/status) when database is opened from main thread. VmPeak: 19780 kB VmSize: 19636 kB VmLck: 0 kB VmPin: 0 kB VmHWM: 1756 kB VmRSS: 1756 kB VmData: 308 kB VmStk: 132 kB VmExe: 8 kB VmLib: 4744 kB VmPTE: 60 kB VmSwap: 0 kB And there are results when sqlite is opened from other thread VmPeak: 158904 kB VmSize: 93368 kB VmLck: 0 kB VmPin: 0 kB VmHWM: 1636 kB VmRSS: 1636 kB VmData: 74040 kB VmStk: 132 kB VmExe: 8 kB VmLib: 4744 kB VmPTE: 60 kB VmSwap: 0 kB Most notable difference is VmData, which is like 80MB in case when the other thread is started. Is there any reason, why sqlite consumes so much memory when started from other thread ? Or do I have any error in my application ? In parallel with this e-mail I also asked on stackoverflow. https://stackoverflow.com/questions/51317823/sqlite-high-ram-usage-when-connected-from-other-thread?noredirect=1#comment89612124_51317823 Every help is highly appreciated. Best Regards, Martin _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users