Created
April 22, 2010 20:06
-
-
Save horatio-sans-serif/375744 to your computer and use it in GitHub Desktop.
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
var fs = require("fs"); | |
sys = require("sys"); | |
if (process.platform.toLowerCase().indexOf("linux") == -1) | |
throw new Error("unsupported platform"); | |
setInterval(function () { | |
fs.readFile("/proc/" + process.pid + "/status", function (err, data) { | |
if (err) { | |
sys.puts(err); | |
return; | |
} | |
var match = data.match(/^VmHWM:\s+(\d+)\s+kB$/m), | |
value = match ? match[1] : 0; | |
sys.puts("peak rss: " + value); | |
sys.puts("from node: " + JSON.stringify(process.memoryUsage())); | |
}); | |
}, 1000); |
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
peak rss: 5068 | |
from node: {"rss":5394432,"vsize":41553920,"heapTotal":2200320,"heapUsed":1066196} | |
peak rss: 5324 | |
from node: {"rss":5451776,"vsize":41553920,"heapTotal":1676032,"heapUsed":1089868} | |
peak rss: 5328 | |
from node: {"rss":5455872,"vsize":41553920,"heapTotal":1676032,"heapUsed":1094656} | |
peak rss: 5332 | |
from node: {"rss":5459968,"vsize":41553920,"heapTotal":1676032,"heapUsed":1098660} | |
peak rss: 5336 | |
from node: {"rss":5464064,"vsize":41553920,"heapTotal":1676032,"heapUsed":1102684} | |
peak rss: 5340 | |
from node: {"rss":5468160,"vsize":41553920,"heapTotal":1676032,"heapUsed":1106688} | |
peak rss: 5344 | |
from node: {"rss":5472256,"vsize":41553920,"heapTotal":1676032,"heapUsed":1110692} | |
peak rss: 5348 | |
from node: {"rss":5476352,"vsize":41553920,"heapTotal":1676032,"heapUsed":1114696} | |
peak rss: 5352 | |
from node: {"rss":5480448,"vsize":41553920,"heapTotal":1676032,"heapUsed":1118720} | |
Command terminated |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment