PDA

View Full Version : Trying to fix the showeq server windows memory leak



ViciousOne618
07-09-2024, 07:57 PM
So i've noticed through the SVN that there hasnt been any contribution on showEQ (windows) since 2022 in fact even finding a decent working knowledge of the windows codebase?

Specifically what I've been trying to get fixed is a massive memory leak within the server itself that only seems to happen during a zone situation
897

898

899

I've even tried adding some memory difference checks in to see if theres a way to track memory leaks but no dice so far.

Any help would be greatly appreciated

cn187
07-09-2024, 08:23 PM
Moved to the correct forum.

I think eqDialup was the last one to have any real knowledge of the windows codebase. I know I certainly don't have any.

That said, I can think of a couple of approaches you might take.

The first is tooling - I'm not really familiar with what's available on windows these days, but if you can find a decent memory profiler, that could at least help narrow things down. I think AddressSanitzer works on windows, and while it's primarily for detecting memory boundary issues, I think it can do alloc/dealloc matching. Otherwise, you'd want to find something like Valgrind, but for windows. (If you're comfortable with Linux, you can use valgrind in conjunction with wine to analyze windows programs)

The second is plain old following the code. If you find the allocations and trace the data through to see where it's getting deallocated, you should eventually find something that isn't freed.

My 2c.

ViciousOne618
07-09-2024, 08:28 PM
Thank you! appologies i shoulda RTFM on that one!

I agree with following the code - honestly i have no idea where to start on this thing - time to buckle up and dig in i guess :D

ViciousOne618
07-09-2024, 08:49 PM
I found a very interesting tool to do this for windows

Very Sleepy - the site has fallen to shambles but the tool is great for tracking memory frames - thank you for this awesome start cn187

Narrowed it down to a method and its now time to fix it!

cn187
07-10-2024, 07:04 AM
Great!

Once you get it figured out, please post a patch.

Thanks.