我的Node.js应用程序达到约6GB的RAM时崩溃,尽管我使用--max-old-space-size=12582912
将限制设置为12GB,但获得了16GB的RAM。
崩溃报告显示以下内容:
"javascriptHeap": {
"totalMemory": 6587056128,
"totalCommittedMemory": 6587056128,
"usedMemory": 6475691160,
"availableMemory": 13410340102832,
"memoryLimit": 13416914837983,
"heapSpaces": {
"read_only_space": {
"memorySize": 524288,
"committedMemory": 524288,
"capacity": 515584,
"used": 33520,
"available": 482064
},
"new_space": {
"memorySize": 33554432,
"committedMemory": 33554432,
"capacity": 16498688,
"used": 15158576,
"available": 1340112
},
"old_space": {
"memorySize": 4832038912,
"committedMemory": 4832038912,
"capacity": 4751797480,
"used": 4741345640,
"available": 10451840
},
"code_space": {
"memorySize": 1048576,
"committedMemory": 1048576,
"capacity": 972992,
"used": 659296,
"available": 313696
},
"map_space": {
"memorySize": 536576,
"committedMemory": 536576,
"capacity": 519168,
"used": 244240,
"available": 274928
},
"large_object_space": {
"memorySize": 1719353344,
"committedMemory": 1719353344,
"capacity": 13412045490080,
"used": 1718249888,
"available": 13410327240192
},
"new_large_object_space": {
"memorySize": 0,
"committedMemory": 0,
"capacity": 0,
"used": 0,
"available": 0
}
}
},
编辑:报告中的环境信息
"header": {
"event": "Allocation failed - JavaScript heap out of memory",
"trigger": "FatalError",
"filename": "report.20190918.213706.2664.0.001.json",
"dumpEventTime": "2019-09-18T21:37:06Z",
"processId": 2664,
"commandLine": [
"C:\\Program Files\\nodejs\\node.exe",
"--max-old-space-size=12582912",
".\\generate_database.js"
],
"nodejsVersion": "v11.13.0",
"wordSize": 64,
"arch": "x64",
"platform": "win32",
"componentVersions": {
"node": "11.13.0",
"v8": "7.0.276.38-node.18",
"uv": "1.27.0",
"zlib": "1.2.11",
"brotli": "1.0.7",
"ares": "1.15.0",
"modules": "67",
"nghttp2": "1.34.0",
"napi": "4",
"llhttp": "1.1.1",
"http_parser": "2.8.0",
"openssl": "1.1.1b",
"cldr": "34.0",
"icu": "63.1",
"tz": "2018e",
"unicode": "11.0"
},
"release": {
"name": "node",
"headersUrl": "https://nodejs.org/download/release/v11.13.0/node-v11.13.0-headers.tar.gz",
"sourceUrl": "https://nodejs.org/download/release/v11.13.0/node-v11.13.0.tar.gz",
"libUrl": "https://nodejs.org/download/release/v11.13.0/win-x64/node.lib"
},
"osName": "Windows_NT",
"osRelease": "10.0.18362",
"osVersion": "Windows 10 Pro",
"osMachine": "x86_64"
},