[POL099] Randomly Mem Leak

Here you can post threads specific to the current release of the core (099)

Moderator: POL Developer

Post Reply
DebugZHI
New User
Posts: 13
Joined: Thu Nov 24, 2016 7:31 am

[POL099] Randomly Mem Leak

Post by DebugZHI »

Hi everyone,

looking on pol-core src i've notice references to "leak.log" used for trace memory leaks events on pol.
Recently we having some issues with memory leak, at randomly.

How we can, enable this log for more investigations?
(or there's another way for checking this issues?)

Best Regards,

DebugZHI
Nando
POL Developer
Posts: 282
Joined: Wed Sep 17, 2008 6:53 pm
Contact:

Re: [POL099] Randomly Mem Leak

Post by Nando »

There is a preprocessor flag "MEMORYLEAK", that if true will enable some debugging in eScript to detect leaks. But it may not detect every leak.

Is it running the latest version from GitHub or did you modify it in any way? Do you know approximately where this leak is happening? Is it related to events somehow? Any specific scripts running around this time?

A good way to test for leaks it to use Valgrind (http://valgrind.org/). It's Linux only and quite slow, but works well. A faster option for Linux would be to use Clang with LeakSanitizer (http://clang.llvm.org/docs/LeakSanitizer.html). On Windows we have used this at some point: https://vld.codeplex.com/, but I'm not sure what is the current support for it in the core.

Be careful when analyzing the output of those leak detectors because false-positives (mostly in the std library) are very common.

And let me know what you find! If you join on IRC I can help analyze the output of the logs.
Post Reply