I’m getting a huge memory spike (500MB) when making a very modest addition (~2000 records to a single table) to a SQLite db.
Actually the first time through the process it doesn’t spike, but additional spikes occur every time I repeat the process thereafter.
That behavior made me think that I must be creating additional objects, and/or not clearing out old ones, each time through. But I have been through the code and created some monitors to watch thread statuses, and I have become comfortable the controlling thread and other objects are properly going out of scope at the end of each iteration (and I’m manually forcing a few objects to Nil after using them, just to be sure). I have looked hard for any circular references and have used a WeakRef to refer from the thread to the DB.
Although I am not entirely certain at this point, I wonder if there is perhaps a SQLite weirdness. Although I don’t know whether they are supported in Xojo’s SQLite implementation, I’ve tried a couple of pragmas (shrink_memory and sqlite3_db_release_memory), but no joy. I’m not sure if that’s because they are not implemented, and so doing nothing, or if the problem lies elsewhere, and so they have no effect.
[EDIT: The database size on disk is about 90 MB and the records I’m adding are about 25 columns, text only, and less than 1 KB each.]
Any general thoughts would be appreciated.
Regards,
Will
IDE on Windows 11 64-bit.
32 GB RAM available.
Xojo v2024r2.1.
Desktop app - Windows 64-bit only.
No plugins related to SQLite.