Thursday 15 March 2012

c++ - Fatal error in ../deps/v8/src/handles.h, CHECK(location_ != NULL) failed / FATAL ERROR: CALL_AND_RETRY_0 Allocation failed - process out of memory -



c++ - Fatal error in ../deps/v8/src/handles.h, CHECK(location_ != NULL) failed / FATAL ERROR: CALL_AND_RETRY_0 Allocation failed - process out of memory -

i installed node on ubuntu server , trying run basic node programme server. in it, seek read in 13 json files, ranging 120mb - 500+ mb. previously, running locally, ok smaller files running next error when trying read larger ones:

fatal error: call_and_retry_0 allocation failed - process out of memory

i need able parse through json object after reading file, can't read line line. , need able build cumulative object results of parsing objects. said, code works fine , produces result expect when handling 3+ smaller files (< 20mb), crashes larger ones.

when trying run on server, have same issue (it'll work fine smaller files), crashes next error on larger ones:

# fatal error in ../deps/v8/src/handles.h, line 48 # check(location_ != null) failed # ==== c stack trace =============================== 1: v8_fatal 2: v8::string::newfromutf8(v8::isolate*, char const*, v8::string::newstringtype, int) 3: node::stringbytes::encode(v8::isolate*, char const*, unsigned long, node::encoding) 4: node::buffer::utf8slice(v8::functioncallbackinfo<v8::value> const&) 5: v8::internal::functioncallbackarguments::call(void (*)(v8::functioncallbackinfo<v8::value> const&)) 6: ?? 7: ?? [1] 12381

illegal hardware instruction (core dumped) node main2.js

this code chunk it's failing in:

for (var = 0; < jsonfilearray.length; i++) { if (jsonfilearray[i].match(/\.json$/)) { jsonobject = json.parse(fs.readfilesync(dirpath + jsonfilearray[i])); categorylistobject = jsonmanipulator.getfieldvalues("categories", jsonobject, categorylistobject); } }

i tried increasing --max-old-space-size, didn't help. also, should clarify, i'm pretty new coding , have never written in c, despite googling this, i'm not sure go next. really, help/guidance/insight/step in right direction super appreciated! thanks!

you're parsing entire huge json file memory can expected. seek using module: https://github.com/dominictarr/jsonstream , read files read stream (http://nodejs.org/api/fs.html#fs_fs_createreadstream_path_options).

c++ json node.js ubuntu memory-management

No comments:

Post a Comment