-
Got JSON.Parse error (out of memory) when querying by view, but cannot enlarge the memory limit for CouchJS DescriptionI have a big json document, ~8Mib, and I have a view in design doc, before I upload that big json to database, the view can work, but after that json uploaded, I get the error log: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- [error] 2020-06-03T06:23:55.623753Z [email protected] <0.9440.545> bfcf299af8 rexi_server: from: [email protected](<0.9427.545>) mfa: fabric_rpc:map_view/5 throw:{os_process_error,{exit_status,1}} [{couch_mrview_util,get_view_index_state,5,[{file,"src/couch_mrview_util.erl"},{line,137}]},{couch_mrview_util,get_view,4,[{file,"src/couch_mrview_util.erl"},{line,81}]},{couch_mrview,query_view,6,[{file,"src/couch_mrview.erl"},{line,247}]},{rexi_server,init_p,3,[{file,"src/rexi_server.erl"},{line,140}]}] Seems that the CouchJS reaches its memory limit, as I split that big json into 2 parts, and upload them respectively, then the issue went away. So I think I need to enlarge the memory limit. I found it in document: https://docs.couchdb.org/en/2.3.1/config/query-servers.html By default, couchjs limits the max runtime allocation to 64MiB. If you run into out of memory issue in your ddoc functions, you can adjust the memory limitation (here, increasing to 512 MiB): COUCHDB_QUERY_SERVER_JAVASCRIPT="/usr/bin/couchjs -S 536870912 /usr/share/server/main.js" I tried that, change the value in "local.ini", even I make the limitation up to 2GiB, but it didn't work, still got "out of memory" error. As I observe the memory used by couch process, at most it takes up to ~300MiB Your Environment
Additional Context |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
In CouchDB 2.3.1 you will have to patch your This is fixed in 3.0.0: https://github.com/apache/couchdb/blob/3.0.0/rel/files/couchdb.in#L39 |
Beta Was this translation helpful? Give feedback.
In CouchDB 2.3.1 you will have to patch your
couchdb
script manually for an override: https://github.com/apache/couchdb/blob/2.3.1/rel/files/couchdb.in#L29This is fixed in 3.0.0: https://github.com/apache/couchdb/blob/3.0.0/rel/files/couchdb.in#L39