Is v8 lazy in some way?
The code that produces the js object calls my data ready hook and all I
want to do is to print the source of the object.
I do this with the following code:
my["node_modules"]["fs"].writeFile ("out.json", JSON.stringifyCircular
(data), my["maybe_log_error"]);
This object contains circular references. The above method works fine for
some example data but with a different and larger example nodejs gives the
following error:
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
So my question is:
Is the data that I am attempting to stringify effectively infinite ?
I could see this being the case if the data passed to my data ready hook is
not a complete object but is lazily evaluated only when I try to stringify
it.
The only other alternative I can think of is if the data contains functions
that are called when attempting to stringify.
Is there any way I can inspect the contents of data without things breaking
like this ?
Alternatively I can try to chase down the code that is producing this data
object, any pointers on what to look for ?
Thanks very much,
Stephen
p.s. I would be happy to share / improve my version of stringify that deals
with circular references.
My motivation was the increased performance from native c++ rather than a
js replacer function.
The performance is nice but it seems that I have bigger problems with this
data object.
--
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to the Google Groups
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.