Some application on my system is leaking resources. But I don't know what it is leaking and which application.
The leak causes other applications to fail with error messages like this:
System Error. Code: 8. Not enough storage is available to process this command.
What tools and/or steps can I use to find out which application is leaking and what it is leaking?
note: I have
- 40% of memory free (of a total of 8 gigabytes)
- 15 gigabytes space free on the boot/system SSD drive
- all the rights I need (can be Admin when needed)
- a Windows 7 development workstation (with things like Visual Studio 2013, Delphi 2007, PL/SQL Developer 9, Office 2013, McAfee 8, IE 11, Chrome 44, Cisco Jabber)
- some developed applications and services running (but not many)
- Our Delphi services and applications run with FastMM in full debug mode and don't show memory leaks.
about 200 string ATOMS in use (see dump at https://gist.github.com/anonymous/a4954baa256ddacbe1a8) so it's not a full ATOM table issue.It was ATOMS, but while refactoring the code by https://stackoverflow.com/users/1108091/jordi-corbilla and https://stackoverflow.com/users/112670/christian-b-almeida I accidentally killed very odd atoms in https://gist.github.com/anonymous/1deb17123d57f160c4b2 which I will answer below.- standard Windows 7 heaps with a large Desktop heap:
SharedSection=1024,20480,768
- it is not the RegisterWindowsMessages either: about 1000 of them in total: https://gist.github.com/anonymous/027b26809d66970b25b8
- it isn't a window handle count either, as
Testlimit -u
can happily allocate 10k USER handles: https://gist.github.com/anonymous/7296453116c5826d632d
Since it could just as well be one of our own developed applications, I ask it here instead of superuser/serverfault. We don't get this on our servers though.
Since I can't answer, here is the elaboration:
The tooling in the "non-duplicate" answer can't pinpoint the source for various reasons:
- they call Windows API functions with wrong data
- they presume Thread IDs are the same as Process IDs
- they contain very limited source code (the most interesting UI application is lacking)
- the binaries of the incomplete source code don't function well using truckloads of CPU and not responding to the UI after initial clicks
- the source does not explain what they do and why they do it
I'm in the midst of combining those pieces of code and refactoring it to a useful console application that:
- shows Atoms and Registered Windows messages
- indicates by which Application
- shows percentage used
- can better estimate what ATOMS to free
That way, dumping the output over time and correlating the diffs it might be possible to zoom in to the offending problem.
The offending ATOM leaks look like this:
Atom 0xD8F8 with name "-%D4#!`````(W!```````@W#````````"
Atom 0xD8F9 with name "-%D4#!`````HT!```````@W#````````"
Atom 0xD8FA with name "-%D4#!`````+R!```````@W#````````"
Atom 0xD8FB with name "-%D4#!`````3P!```````@W#````````"
Atom 0xD8FC with name "-%D4#!`````*S!```````@W#````````"
Atom 0xD8FD with name "-%D4#!`````KO!```````@W#````````"
Atom 0xD8FE with name "-%D4#!`````,T!```````@W#````````"
Statistics look like this:
Total Global Atoms: 6405
Total is 39 percent of maximum 16384 Global Atoms.
Total Registered WindowsMessages: 1940
Total is 11 percent of maximum 16384 Registered WindowsMessages.