I’m still playing with the 12Mb XML file. The syntax scanner matches more than a million times on a pattern in this file (1038246 to be precise). Each time we have a match, we store the context stack and the blockstack.The cache structures consume 56Mb and it needs 40Mb of GSequenceNodes. The items on the stack are refcounted, so their memory consumption isn’t spectacular. There are 221348 blocks in this file, that use 5.1Mb and 570036 context changes that use 8.9Mb memory. But the stack itself is a GList. Actually, we have about 2 Million GList’s here (for every cache item two stacks), and together they consume a whopping 277Mb of memory for this file!!!
What to do: don’t store the complete blockstack and contextstack every time we find a match.That would help to reduce the 277Mb for the stacks. That still leaves the 96Mb for the cache structures and the balanced tree..