You are not logged in.
I have a project might be a little different than the usual use cases, and I want some general advises as to reducing **memory use** and **improving performance**.
- The program will open a folder which might contain a lot of files and subfolders.
- In each subfolder there is a sqlite db and its corresponding TSQLRestServerDB be created.
- for each file the program will create an object of a TSQLRecord-decendent for it.
The problem is that for folders with many subfolders, the RAM consumption go up.
Any options to reduce the memory consumption for TSQLRestServerDB and TSQLRecord objects?
Thanks!
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
What takes memory is the SQLite3 internal cache.
You can
1. Reduce the cache size assigned with each TSQLRestServerDB
2. Maintain a pool of TSQLRestServerDB, and keep only e.g. the last 20 instances in memory
I usually used a combination of the two, on production, in such use cases.
Offline
@ab,
Thanks! Very helpful!
I also noticed TSQLDataBase.SetUseCache will create a TSynCache object:
TSynCache.Create(16384*1024,true)
which is a 16-Mb framework-level cache.
Unfortunately, the size of the TSynCache size is hard-coded. Any chance to make it configure-able?
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Please check https://synopse.info/fossil/info/26dc0a3497
Offline
Great! Thanks! Excellent support of an open source project, as always!
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline