On Fri, 2004-09-17 at 14:24, bulia byak wrote:
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.
It would be more helpful to try versions immediately before and after I turned on libgc. There were other changes since 0.39 too, and I don't think the collector -- by itself -- is the problem.
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.
Once memory has been collected it is immediately available for reuse by new allocations (within Inkscape).
Note that the allocator looks for existing unused/collected memory in the heap before requesting more memory from the system...
If this is a problem with boehm-managed memory, it must be because objects are not getting collected.
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%.
There is no background thread performing collections; collections only run:
* automatically, when you allocate memory via GC_malloc() or a related function (any of the C++ new operators I wrote do this)
* when you explicitly call GC_gcollect()
(Note that automatic collection passes only run every so many bytes allocated, to spread out the amount of work done. One collection run scans the entire heap.)
Since Inkscape isn't allocating any memory when it's just sitting there, it won't free any memory either. You'd have to be actively doing something that caused (GCed) memory allocations.
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.
I'm well aware of the problem and its severity; e.g. I OOMed my machine in the middle of a large art project last night.
On the other hand I only have a limited amount of time available lately.
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.
This sounds like a good steps-to-reproduce. Thanks.
-mental