madCollection should detect Atom leaks

contains all delphi packages mentioned below
Post Reply
advwang
Posts: 11
Joined: Fri Mar 15, 2019 4:48 am

madCollection should detect Atom leaks

Post 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.
madshi
Site Admin
Posts: 10528
Joined: Sun Mar 21, 2004 5:25 pm

Re: madCollection should detect Atom leaks

Post 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.
advwang
Posts: 11
Joined: Fri Mar 15, 2019 4:48 am

Re: madCollection should detect Atom leaks

Post 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.
madshi
Site Admin
Posts: 10528
Joined: Sun Mar 21, 2004 5:25 pm

Re: madCollection should detect Atom leaks

Post 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.
slemmnord
Posts: 43
Joined: Fri Jan 17, 2014 1:04 am

Re: madCollection should detect Atom leaks

Post by slemmnord »

I already fixed my vcl atom leaks but still would be nice to have it included. +1 from me :)
Post Reply