I think I found the root of the problem. I compiled 0.39 and tested, and it does not exhibit this kind of behavior. Memory consumption grows by 0.4% on first export and stays the same on subsequent exports.
In 0.39, we did have livarot the same as now, but we didn't yet use boehm. So I think it's highly likely that the boehm gc does not do its work properly. Maybe it collects the garbage, but it does not seem to free it.
- the garbage collector inherently introduces a small amount of slush, since it doesn't free memory immediately after it becomes unused
And no, it does not free it afterwards. I let Inkscape grab 60% memory and left it on overnight. In the morning, it still held the same 60%.
So, Mental, could you please look into it? Perhaps we're misconfiguring libgc or not using it properly. It's a VERY annoying problem which needs urgent resolution. For example it makes previews in the open dialog unusable: each preview loads the document, and since the memory is not freed, it quickly eats up all available memory as you go through the files in a directory. Just go through a couple dozen files, and you're lucky if you manage to kill Inkscape before it bogs the system down to a complete halt.