Page 1 of 1

madCollection should detect Atom leaks

Posted: Sun Mar 31, 2019 12:41 am
by advwang
madCollection should detect Atom leaks (AddAtom, DeleteAtom pairs). This kind of leak is very serious. Even if the program exits, Atom will not be released. Many times later, system resources will be exhausted. So after detection, I hope to automatically release the corresponding Atom. Thank you.

Re: madCollection should detect Atom leaks

Posted: Mon Apr 01, 2019 10:16 am
by madshi
As far as I understand the documentation, AddAtom is "local" and should therefore bereleased when the process goes down? Are you talking about "GlobalAddAtom", maybe? I'm not 100% sure about this, though, because the MS documentation is not very detailed.

Re: madCollection should detect Atom leaks

Posted: Tue Apr 02, 2019 3:15 am
by advwang
Oh, I am sorry, I am talking about GlobalAddAtom., MSDN is like this:

The string associated with the atom is not deleted from memory until its reference count is zero. For more information, see the GlobalDeleteAtom function.
Global atoms are not deleted automatically when the application terminates. For every call to the GlobalAddAtom function, there must be a corresponding call to the GlobalDeleteAtom function.

Now the leak of GlobalAddAtom is not detected, I hope to add detection
In addition, AddAtom also adds detection, as a good habit of programming, thank you for your reply.

Re: madCollection should detect Atom leaks

Posted: Tue Apr 02, 2019 8:19 am
by madshi
I'll add it to my to do list, but it might take a while until I get to it. Atoms don't really match any other "leak category" I'm currently looking for, so it will require some changes to my code to add a new leak category for it.

Re: madCollection should detect Atom leaks

Posted: Sat Apr 06, 2019 6:30 pm
by slemmnord
I already fixed my vcl atom leaks but still would be nice to have it included. +1 from me :)