Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix mem leak in LuaManager #1066

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

Merged
botder merged 1 commit into multitheftauto:master from pentaflops:master
Aug 28, 2019
Merged

Fix mem leak in LuaManager #1066

botder merged 1 commit into multitheftauto:master from pentaflops:master
Aug 28, 2019

Conversation

@pentaflops
Copy link
Contributor

@pentaflops pentaflops commented Aug 21, 2019

After disconnecting from the server, the CLuaManager should cleanup LuaVM, but does not

With love from NEXTRP Team

@pentaflops pentaflops changed the title (削除) [IMPORTANT] Fix mem leak in LuaManager (削除ここまで) (追記) Fix mem leak in LuaManager (追記ここまで) Aug 21, 2019
@qaisjp qaisjp added the bug Something isn't working label Aug 21, 2019
Copy link
Contributor Author

This is a critical leak :)

Copy link
Contributor

qaisjp commented Aug 27, 2019

Thank you for the fix!

Copy link
Contributor

patrikjuvonen commented Aug 27, 2019
edited
Loading

I'm just curious to understand how https://github.com/multitheftauto/mtasa-blue/blob/master/Client/mods/deathmatch/logic/CClientGame.cpp#L1126 fails to free the memory in this case. I'm not exactly sure as to how the pulses work, but isn't ProcessPendingDeleteList() getting called? Do you have some stats that can show how significant the memory leak is as you're describing it to be "critical"? I suppose it makes sense to call the function in destructor though...

Copy link
Member

botder commented Aug 27, 2019

Leaving a server deletes CClientGame including CLuaManager. You don't run the pulse anymore to clean up afterwards.

Copy link
Contributor

Leaving a server deletes CClientGame including CLuaManager. You don't run the pulse anymore to clean up afterwards.

Ok, we should cross check for other missing cleanups elsewhere too.

Copy link
Contributor Author

pentaflops commented Aug 28, 2019
edited
Loading

I suppose it makes sense to call the function in destructor though...

This is exactly what was done.

Do you have some stats that can show how significant the memory leak is as you're describing it to be "critical"?

In the discord channel, I send screenshots showing a leak when disconnecting (reconnecting) and when restarting resources (when the player is on the server).

Copy link
Member

botder commented Aug 28, 2019

I don't see any reason not to merge this pull request and I have tested it. Thanks for the work.

@botder botder merged commit b890dee into multitheftauto:master Aug 28, 2019
@botder botder added this to the 1.5.7 milestone Aug 28, 2019
Copy link
Contributor

qaisjp commented Aug 28, 2019

Copied from @pentaflops' messages on Discord

before

image

after

image

Before the fix, the game crashed after 5 reconnections to the server. Now this is not observed (if you do not take into account the memory leak RW).

botder, patrikjuvonen, and Emka877 reacted with thumbs up emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

bug Something isn't working

Projects

None yet

Milestone

1.5.7

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /