- The problem is limited to Mail.app. I was wrong about Firefox - it is NOT affected.
- Mail.app in Snow Leopard (OSX 10.6 is not affected either.
Bad news is that Mail.app in Leopard (OSX 10.5) seems to be even worse than the Tiger version.
I wrote a test app that basically counts all AXUIElements under the application menu bar. When doing this, every element found is asked for its attribute names ( AXUIElementCopyAttributeNames() ), and, if present, for its AXChildrenAttribute.
I found that Mail.app not only allocates exponentially increasing memory space, but also returns an exponentially growing number of AXUIElements!
If, during counting, each element returned is asked for another attribute value (for example its AXRole), memory usage and the number of elements returned immediately again increases by about factor 2.
For the Tiger version, I found a fairly acceptable workaround by alternately selecting and deselecting the "Apple" menu periodically.
For Leopard, the workaround doesn't fix the problem, though it results in some improvement - the additional memory allocated doesn't increase as much as without the workaround, but it still does. Memory is freed only when the test app is terminated, while in Tiger terminating the test app has no effect.
Since also OSX 10.5 is concerned, do you think I should file a bug?
I wouldn't mind sending my test app (including XCode project) to whoever is interested.
Peter