Fix issue where GC is not free'd until a BGSAVE
Former-commit-id: e19350005b571591876e49219bfca75e905604a5
This commit is contained in:
parent
86a5b2fbc7
commit
c0e80ffcda
@ -2440,6 +2440,16 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
|
|||||||
/* CRON functions may trigger async writes, so do this last */
|
/* CRON functions may trigger async writes, so do this last */
|
||||||
ProcessPendingAsyncWrites();
|
ProcessPendingAsyncWrites();
|
||||||
|
|
||||||
|
run_with_period(10) {
|
||||||
|
// Server threads don't free the GC, but if we don't have a
|
||||||
|
// a bgsave or some other async task then we'll hold onto the
|
||||||
|
// data for too long
|
||||||
|
g_pserver->asyncworkqueue->AddWorkFunction([]{
|
||||||
|
auto epoch = g_pserver->garbageCollector.startEpoch();
|
||||||
|
g_pserver->garbageCollector.endEpoch(epoch);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
g_pserver->cronloops++;
|
g_pserver->cronloops++;
|
||||||
return 1000/g_pserver->hz;
|
return 1000/g_pserver->hz;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user