After a "bad collections", avoid switching back back to generational
After a major bad collection (one that collects too few objects), next collection will be major again. In that case, avoid switching back to generational mode (as it will have to switch again to incremental to do next major collection).
This commit is contained in:
1 parent
264659bd53
commit
2c32bff609
6 files changed
+135
-51
No files matched your search
@@ -11,6 +11,12 @@ collectgarbage()
|
||||
|
||||
local oldmode = collectgarbage("incremental")
|
||||
|
||||
-- changing modes should return previous mode
|
||||
assert(collectgarbage("generational") == "incremental")
|
||||
assert(collectgarbage("generational") == "generational")
|
||||
assert(collectgarbage("incremental") == "generational")
|
||||
assert(collectgarbage("incremental") == "incremental")
|
||||
|
||||
|
||||
local function gcinfo ()
|
||||
return collectgarbage"count" * 1024
|
||||
|
||||
Reference in new issue
Block a user