Jump to content

[FIX] Fixing Metin2 memory leaks


Recommended Posts

  • Wiki Manager

Memory leaks are very important when we speak about reusing memory, it prevents the game to keep allocating new RAM over and over.

WIth this simple fixes memory leaks on Metin2 will be fixed.

 

1. Server

Open the file game/main.cpp

Search this function:

int main(int argc, char **argv)
{

After this add the following code:

return 0;

Now open the file db/Main.cpp.

Search this function:

int main()
{

After this add the following code:

return 0;

 

2. Client

Open the file UserInterface/UserInterface.cpp

Search this function:

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{

After this add the following code:

return 0;

 

I hope it will works now, enjoy just 200MB for a complete client.

Good luck.

  • Love 14
  • Lmao 14
  • Confused 1

Ripymir(2013)

Link to post
  • VIP
49 minutes ago, HITRON said:

Stop releasing the secrets for fixing memory leaks ffs.

Cit. "I just want them for my server/customers, I'm on this forum just to take things and not to give."
The issue can be found by clang tool too, it's not magic.


Anyway thanks Arves for this tip :D

Edited by WeedHex
Link to post
  • Engineer

Excellent work!

 

It's just mastermind because we all tried to fix memory leaks by ourselves and try to analize them while in fact we can simply tell the game to return 0 to every memory it stores once it used it. Excellent. Deserved +1

  • Love 2
Link to post

Thanks again, I'm not paying anymore host 300€ with 64GB Ram, Now is enough to use even 4GB Ram without problems and still too much and only for 20€ per month, you have helped me a lot, send me your PayPal so i can donate some € for this amazing tutorial!

  • Love 2
Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



Shoutbox

Shoutbox

Chatroom Rules

 

Join our Discord

A request for help = Shoutbox Ban

Be respectful & Respect the rules

 

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.