mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 18:35:46 +02:00
fix(flushall): Decommit memory after releasing tables. (#2691)
In the fiber we used to call `mi_heap_collect()` when we're done deleting items. But since that fiber captures a `vector` of intrusive pointers to `DbTable`s, it can't free all memory used by the tables themselves. A local test shows that this fix helps almost entirely: when occupying a 5gb DB, `FLUSHALL` will reduce RSS by 4.7gb, leaving 300mb still used. A follow up `MEMORY DECOMMIT` *will* indeed remove these 300mb, but I'm still not sure why they are not released immediately. Still looking... Addresses (1) of #2690
This commit is contained in:
parent
30ce250ab2
commit
35b0ab101e
1 changed files with 1 additions and 0 deletions
|
@ -764,6 +764,7 @@ void DbSlice::FlushDbIndexes(const std::vector<DbIndex>& indexes) {
|
|||
db_ptr.reset();
|
||||
}
|
||||
}
|
||||
flush_db_arr.clear();
|
||||
mi_heap_collect(ServerState::tlocal()->data_heap(), true);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue