2

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

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.
Community
  • 1
  • 1
  • have a look at [FastMM](http://sourceforge.net/projects/fastmm/) and at [this question](http://stackoverflow.com/questions/6075554/how-do-i-turn-on-off-fastmm-memory-leak-reporting-under-delphi-xe) – fantaghirocco Aug 07 '15 at 08:01
  • @fantaghirocco i don't think it's not a memory issue: I've plenty of memory free. Our Delphi services and applications run with FastMM and don't show memory leaks (I will add that to the question). – Jeroen Pluimers - Binck Aug 07 '15 at 08:12
  • 1
    See [System Error. Code: 8. Not enough storage is available to process this command](http://stackoverflow.com/q/507853/576719). Resource Heap storage shortage. – LU RD Aug 07 '15 at 08:41
  • Jeroen, don't you think it is hard for us to tell where your system is leaking resources, remotely? "Not enough storage" means what kind of storage exactly? FWIW I did not downvote, but I can understand if someone did. – Rudy Velthuis Aug 07 '15 at 08:43
  • 1
    Fwiw, what the linked "Not enough storage" q which this one is said to duplicate, it doesn't seem to mention that this error can arise in the course of a Delphi app invoking an external COM object (the one for the Lotus Notes client, iirc). – MartynA Aug 07 '15 at 09:04
  • @RudyVelthuis that's what I want to find out: which resource is leaking. I'll try the ATOM table thing (first need to get that working in Delphi 2007) and report back next week. – Jeroen Pluimers - Binck Aug 07 '15 at 10:57
  • @MartynA I'll try to figure that out as well. Thanks. – Jeroen Pluimers - Binck Aug 07 '15 at 10:57
  • @LURD it is not the resource heap, not the ATOM table and not the RegisterWindows Messages table. Any more ideas? – Jeroen Pluimers - Binck Aug 11 '15 at 15:50
  • 1
    @LURD it was atoms, but not the Delphi based atoms mentioned in the other answer. I'd like to elaborate here in an answer on how and why the tools in the other answer were only partially of help especially as they can't point the offending program. – Jeroen Pluimers - Binck Aug 13 '15 at 15:05
  • Ok, question is opened. – LU RD Aug 13 '15 at 18:31
  • @LURD thanks a lot. Will update the answer over time. – Jeroen Pluimers - Binck Aug 14 '15 at 09:07

1 Answers1

1

It took a long time figuring out, and I will edit both the question over time.

The culprit are two kinds of Global ATOMs that are sometimes related. There are a few Delphi related Global ATOMs, but that is like 5% of the total.

First a lot of Global ATOMs are sporadically created with this pattern:

Global Atom 0xDE4E with name "-%D4#!`````Y0````````03(````````"
Global Atom 0xDE4F with name "-%D4#!`````Y$````````P[!````````"
...
Global Atom 0xDE66 with name "-%D4#!`````MG````````P[!````````"
Global Atom 0xDE67 with name "-%D4#!`````!'````````0)1````````"
...
Global Atom 0xEE0F with name "-%D4#!`````AJ!```````0('````````"
Global Atom 0xEE10 with name "-%D4#!`````BJ!```````0('````````"

Even less Global ATOMs are created with this pattern:

Global Atom 0xEE11 with name "MSAA:000034C0:00001950:00000701:000034C0:"
Global Atom 0xEE12 with name "MSAA:000034C0:000018C8:00000702:000034C0:"
...
Global Atom 0xEE25 with name "MSAA:000034C0:00001758:000006EC:000034C0:"
Global Atom 0xEE26 with name "MSAA:000034C0:0000197C:000006ED:000034C0:"

The combination of many "random" and a few "MSAA" seems to happen when I've been running "Microsoft Test Manager 2013" which seems to use MSAA technology. A log is here: https://gist.github.com/anonymous/44080c2a20b98a5e8607

I'm in the midst to

  1. refine and refactor the tool dumping this information
  2. find more correlation on the "random" ATOMs (I've seen them occur when not running "Microsoft Test Manager 2013" yet.

I will update this answer when I zoom in on the cause, and have updates on the tool.

  • 1
    How did you find the source of the Global ATOMs? How did you determine which application was causing the issue? – Michael Oct 16 '15 at 13:14