Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(368)

Side by Side Diff: appengine/config_service/ui/bower_components/async/perf/memory.js

Issue 2923973003: Added base template for config ui. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 if (process.execArgv[0] !== "--expose-gc") {
2 console.error("please run with node --expose-gc");
3 process.exit(1);
4 }
5
6 var async = require("../");
7 global.gc();
8 var startMem = process.memoryUsage().heapUsed;
9
10 function waterfallTest(cb) {
11 var functions = [];
12
13 for(var i = 0; i < 10000; i++) {
14 functions.push(function leaky(next) {
15 function func1(cb) {return cb(); }
16
17 function func2(callback) {
18 if (true) {
19 callback();
20 //return next(); // Should be callback here.
21 }
22 }
23
24 function func3(cb) {return cb(); }
25
26 async.waterfall([
27 func1,
28 func2,
29 func3
30 ], next);
31 });
32 }
33
34 async.parallel(functions, cb);
35 }
36
37 function reportMemory() {
38 global.gc();
39 var increase = process.memoryUsage().heapUsed - startMem;
40 console.log("memory increase: " +
41 (+(increase / 1024).toPrecision(3)) + "kB");
42 }
43
44 waterfallTest(function () {
45 setTimeout(reportMemory, 0);
46 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698