Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for weak tables that survive #73

Merged
merged 4 commits into from
Mar 31, 2024
Merged

Fix for weak tables that survive #73

merged 4 commits into from
Mar 31, 2024

Conversation

4z0t
Copy link

@4z0t 4z0t commented Mar 26, 2024

Problem
No fix

info: 338    676
info: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
info: 1559    3119
info: 689    1379

Fix

INFO: 338    676
INFO: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
INFO: 1559    3119
INFO: 338    676

Run in the end of init file

collectgarbage()
LOG(gcinfo())
LOG("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")
a = {}
for i = 1, 10000 do
    a[i] = setmetatable({}, { __mode = "v" })
end
collectgarbage()
LOG(gcinfo())
a = nil
collectgarbage()
LOG(gcinfo())

Note:

gcinfo returns two results: the number of Kbytes of dynamic memory that Lua is using and the current garbage collector threshold (also in Kbytes).

@Garanas Garanas marked this pull request as draft March 26, 2024 09:31
@4z0t 4z0t changed the title Draft fix for weak tables that survive Fix for weak tables that survive Mar 28, 2024
@4z0t 4z0t marked this pull request as ready for review March 28, 2024 20:56
@Garanas Garanas merged commit 189eed5 into FAForever:master Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants