stardust alpha-2610212237
- per-thread leak: open, 4 MB to 0.4 MB per thread
- schema clause leak: fixed
- an asOf parameter can't default to null:
todos/list-atdefaults ?at to 1 reactors syncis gone- thinking about an async abi: which calls wait
open
per-thread leak
each thread that calls stardust leaves memory behind that's never freed. on this release it's about 0.4 MB per thread, down from 4 MB. a fixed pool of threads stays flat.
| queries | now | before | now, 4 reused threads |
|---|---|---|---|
| start | 14 MB | 15 MB | 14 MB |
| 100 | 51 MB | 373 MB | 33 MB |
| 200 | 89 MB | 781 MB | 33 MB |
| 300 | 127 MB | 1189 MB | 33 MB |
| 400 | 161 MB | 1597 MB | 33 MB |
leak.c, 112 lines, the same as in alpha-2610171653
// Stardust C ABI only. Creates an empty database, then runs the same inline
// query 400 times one of two ways, printing resident size after every 100:
//
// MODE=new (default) each query on a new pthread, joined before the next
// starts
// MODE=pool on 4 pthreads that live for the whole run, 25 queries each per
// 100
//
// STARDUST_LICENSE=... MODE=new ./leak new.db
//
// What grows per new thread, as measured (alpha-2610171653 and
// alpha-2610212237):
//
// - an inline query (STARDUST_SOURCE_DOCUMENT): every one tried, with one
// clause or two, with or without orderBy, on an empty database or one
// with matching entities
// - a stored query (STARDUST_SOURCE_PATH) with orderBy, when its result
// is empty or it joins two clauses
//
// What stays flat: a stored query with one clause and matching rows, with or
// without orderBy, and a stored query with two clauses and no orderBy on an
// empty database.
static stardust_db *db;
static stardust_document *query_doc;
static pthread_barrier_t step;
static stardust_bytes
static long
static void
static void
static void *
// A pool worker: 25 queries, then wait for the report, four times.
static void *
int
fixed
schema clause leak
a subscription to a query with a schema clause leaked memory on every commit, and kept it after the subscription was released. on this release it stays flat.
| now | before | now, no clause | |
|---|---|---|---|
| round 1: start | 26 MB | 16 MB | 26 MB |
| 100 commits | 34 MB | 50 MB | 34 MB |
| 200 commits | 34 MB | 74 MB | 34 MB |
| 300 commits | 34 MB | 101 MB | 34 MB |
| 400 commits | 35 MB | 126 MB | 35 MB |
| released | 35 MB | 126 MB | 35 MB |
| round 2: start | 35 MB | 125 MB | 35 MB |
| 100 commits | 35 MB | 152 MB | 36 MB |
| 200 commits | 35 MB | 177 MB | 37 MB |
| 300 commits | 36 MB | 203 MB | 38 MB |
| 400 commits | 38 MB | 230 MB | 39 MB |
| released | 38 MB | 230 MB | 39 MB |