Hi Scott,
DOMDocument nodes keep a list of memory blocks used to allocate all the nodes belonging to its tree; using a memory pool allows faster node creation and deletion. These chunks are by default 64Kb big, and there will always be at least one chunk allocated (inside the constructor there is an allocation that force the allocation of the first memory chunk). I don't see how this could be easily changed, so the quick fix for your problem would be to reduce that value to a level that doesn't waste too much memory but doesn't hurt performances too much.

Hope this helps,
Alberto

At 19.09 10/08/2005 -0400, Scott Cantor wrote:
Maybe this is sort of well-understood by people, but I was rather surprised
to find that every single DOM document I create and hold is reserving 64k
blocks right off the bat due to the size of the kHeapAllocSize constant
inside DOMDocumentImpl.cpp

I couldn't figure out why I was losing so much RAM to cached documents that
are much smaller than that.

Is there any thought to maybe making this constant adjustable in some way? I
couldn't find any way to change it programmatically, but for applications
that manipulate many smaller documents, this seems like a desirable feature
to me.

Note that plugging in my own memory manager wouldn't really help, since I'd
still have to hand back 64k from somewhere to every document to let it do
all the suballocation of nodes and strings, right?

If there's a fix for this I'm not seeing, apologies in advance.

-- Scott


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to