Switch string pool from memory to disk when memory is 10% full

This commit is contained in:
Erica Fischer
2023-01-18 13:45:16 -08:00
parent 1ef0f260f1
commit 01aa8358f0
+4 -2
View File
@@ -77,8 +77,10 @@ long long addpool(struct memfile *poolfile, struct memfile *treefile, const char
}
}
// Size of memory divided by 5 from observation of OOM errors on ECS
if ((size_t) (poolfile->off + treefile->off) > memsize / CPUS / 5) {
// Size of memory divided by 10 from observation of OOM errors (when supposedly
// 20% of memory is full) and onset of thrashing (when supposedly 15% of memory
// is full) on ECS.
if ((size_t) (poolfile->off + treefile->off) > memsize / CPUS / 10) {
// If the pool and search tree get to be larger than physical memory,
// then searching will start thrashing. Switch to appending strings
// to the file instead of keeping them in memory.