I tried this out. It looks like it has less to do with the fact that
you're using buffers and more with the delay while you load the
buffers. I timed it and it takes approx 500ms. That seems to be
enough time for the gc to run. I confirmed this by combining our two
tests. If i run the buffer load and do the xml parse, the memory
stays low.
My guess is that because buffer memory is allocated manually, outside
of v8 space, it's collected and freed correctly. The issue is with
persistent v8 handles because the destructors aren't called in a
timely fashion. I'm thinking the problem is that we need to register
the memory allocated by libmxl for nodes with v8. It seems that v8
doesn't keep track of memory allocated by other libs so it doesn't
count that when it's cosidering when to run the gc. See this article
for a better explanation.
http://create.tpsitulsa.com/wiki/V8/Garbage_Collection
I'mg gonna look into this over the weekend.
:Marco