ArangoDB版本:3.3.14
应用堆统计:
{ total_heap_size: 39108608,
total_heap_size_executable: 3670016,
total_physical_size: 37433512,
total_available_size: 8735662896,
used_heap_size: 28891504,
heap_size_limit: 8769069275,
malloced_memory: 16384,
peak_malloced_memory: 168484640,
does_zap_garbage: 0 }
我有一个遍历api,它遍历3个顶点并返回大约300个文档顶点。 对于200,我得到了正确的响应,但是当我将顶点数增加到300时,遍历api会抛出错误的无效字符串长度。我已经将应用程序的堆空间增加到了8GB,但是可以看到下面的heap_used太少了。我不确定这个问题是否发生在序列化到JSON期间,因为有足够的堆内存可用,或者是否有其他可用的选项来获取完整的数据。
AQL查询(如果适用):
{"request":{"vertex":"start_vertex","start_vertex":"service_teams/9a2e582997494bee9066bbcf2aa52218","start_vertices":null,"opts":{"expander":"var connections = [];\n config.datasource.getOutEdges(vertex).forEach(function (e) {\n if( (e._id.indexOf(\"loc_has_parent_loc\") > -1) || (e._id.indexOf(\"loc_is_associated_with_org\") > -1) || (e._id.indexOf(\"st_is_allocated_loc\") > -1) ) {\n connections.push({ vertex: require(\"internal\").db._document(e._to), edge: e});\n }\n });\n return connections;"},"collection_name":"","edge_name":"","data":true,"path":false}},"err":{"code":500,"message":"Invalid string length"}}
答案 0 :(得分:0)
您在这里看到的错误消息是V8错误消息,因此这是javscript实现的限制。 V8允许的字符串最大为256 MB。
旧的图遍历API是用Javascript实现的,并且处理过程中可能会在文档之间进行字符串化,从而达到此限制。
请prefer AQL-Traversals instead以获得更好的性能。