Created
August 16, 2011 10:03
-
-
Save andreyvit/1148761 to your computer and use it in GitHub Desktop.
Node.js (x64) runs out of memory despite using less than 2G
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% coffee test.coffee | |
MEM: rss 0.02 Gb, vsize 2.91 Gb, heapTotal 0.01 Gb, heapUsed 0.01 Gb | |
File no. 1 | |
process: 2474ms | |
MEM: rss 0.24 Gb, vsize 3.11 Gb, heapTotal 0.23 Gb, heapUsed 0.22 Gb | |
File no. 2 | |
process: 4509ms | |
MEM: rss 0.64 Gb, vsize 3.5 Gb, heapTotal 0.63 Gb, heapUsed 0.6 Gb | |
File no. 3 | |
process: 3076ms | |
MEM: rss 0.76 Gb, vsize 3.62 Gb, heapTotal 0.75 Gb, heapUsed 0.72 Gb | |
File no. 4 | |
process: 4127ms | |
MEM: rss 0.87 Gb, vsize 3.73 Gb, heapTotal 0.85 Gb, heapUsed 0.83 Gb | |
File no. 5 | |
process: 3347ms | |
MEM: rss 0.98 Gb, vsize 3.84 Gb, heapTotal 0.97 Gb, heapUsed 0.95 Gb | |
File no. 6 | |
FATAL ERROR: JS Allocation failed - process out of memory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
index = 0 | |
urls = {} | |
for file in [1 .. 20] | |
((m) -> G=1024*1024*1024; console.log("MEM: rss #{Math.round(m.rss/G*100)/100} Gb, vsize #{Math.round(m.vsize/G*100)/100} Gb, heapTotal #{Math.round(m.heapTotal/G*100)/100} Gb, heapUsed #{Math.round(m.heapUsed/G*100)/100} Gb"))(process.memoryUsage()) | |
console.log "File no. #{file}" | |
console.time 'process' | |
for i in [0 .. 1500000] | |
url = "url#{index++}" | |
urls[url] = { humans: 0, robots: 0 } | |
console.timeEnd 'process' | |
undefined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment