On Fri, May 7, 2010 at 3:50 PM, Marco Rogers <[email protected]> wrote:

> So rather than trying to be surgical with the calls to AAoEAAM, I was

thinking of maintaining a variable with the total memory used.  And
> everytime something is allocated or freed then I would decrement by
> the previous value, and immediately increment by the new total memory
> value.  Does anyone see problems with this level of "churn" on the
> memory hints?
>

That would be my instinct as well. Alternately, you could increase the count
when an element is read (e.g. use the XML's length, plus maybe some fudge
factor), but that assumes that the elements have a "weak destructor" which
allows them to tell v8 about the change when the elements themselves are
destroyed. If your elements are C++ bound classes then that probably isn't
much work, whereas if they are plain JS objects it would be problematic to
capture the destruction for purposes of decrementing the memory use.


-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to