Repository navigation
Description
ArcadeDB is known to use a lot of memory for an embedded database, and that matters twice: for the embedded packages in Python processes (small services, agents, notebooks) and for the server. This issue tracks measuring it properly and then bringing it down. It is tracked here, in the bindings repository, until the numbers say which parts belong to the engine.
First baseline (one run each, laptop, 2026-11-10)
A Python 3.12 process with a small service stack imported (mcp, starlette, uvicorn), then one embedded engine: a type with a unique index, 10,000 rows, then 100,000 more, 200 indexed point queries. Resident set size (RSS) in MB at each stage. SQLite is the standard library sqlite3 (3.50.4); ArcadeDB is 26.11.1, native and JVM wheels.
| stage | SQLite RSS MB | ArcadeDB native MB | ArcadeDB JVM MB |
|---|---|---|---|
| python started | 13.5 | 13.2 | 13.2 |
| imported mcp, starlette, uvicorn | 67.1 | 62.1 | 62.1 |
| imported the database library | 67.1 | 63.2 | 65.9 |
| created an empty database | 67.4 | 98.3 | 147.8 |
| inserted 10,000 rows | 68.3 | 142.2 | 211.0 |
| one count query | 68.3 | 149.9 | 212.4 |
| inserted 100,000 more rows | 70.3 | 174.4 | 368.1 |
| 200 indexed point queries | 70.3 | 172.3 | 368.8 |
| closed the database | 70.3 | 172.8 | 369.0 |
| peak over the run | 82.6 | 201.1 | 391.5 |
Reading: SQLite adds about 3 MB for 110,000 rows. Measured from the row where the service stack is imported, ArcadeDB adds about 112 MB (native) and about 306 MB (JVM) for the same rows, and an empty database alone costs about 35 MB (native) and about 82 MB (JVM). The Python stack itself is about 49 MB over a bare interpreter, so it is not the main cost. This is one run on one machine, not a result; repeat it before quoting.
What to find out first (hypotheses, not facts)
Where the memory goes, per stage, for each package:
- Native wheel: the image heap and the isolate's heap policy (the bindings set a percentage of RAM), page cache size (
arcadedb.maxPageRAM), write-ahead log and async executor buffers, thread stacks, class and resource data loaded at start (vector, Lucene, query engines that this process never uses). - JVM wheel: the default
-XX:MaxRAMPercentage=50the bindings set (heap grows toward it before the garbage collector runs), metaspace and code cache, JIT threads, the same page cache and executor buffers; class-data sharing (JVM wheel: cold first reads and idle memory: measure warm-up properly, then add a CDS archive #313) for the start-up side. - Both: what is a fixed cost of opening a database and what grows with data.
Plan
- A footprint ladder in the benchmark's next instrument (the benchmark records memory per phase today, but not an idle-to-first-rows staircase): the same staircase for ArcadeDB (native, JVM, and the official server image at idle), SQLite, DuckDB and LadybugDB, plus a breakdown inside ArcadeDB (JVM native memory tracking for the JVM wheel; the image heap and allocator counters for the native wheel).
- Find the knobs that lower the footprint without hurting the default workloads (page cache, heap policy, executor threads, lazy loading of unused subsystems), and measure each as an A/B with the usual rules.
- Set a target per package (for example: empty database and first 10,000 rows) and track it; open engine issues, each with a Java repro and one question, only for the parts the bindings cannot change.
Related: #313 (JVM cold start and idle memory, CDS archive), #315.
Activity