mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
mem
This commit is contained in:
parent
f10f7e5118
commit
4b0f0f3538
2
gun.js
2
gun.js
@ -1156,7 +1156,7 @@
|
||||
var stat = console.STAT || {};
|
||||
console.log('HEAR:', peer.id, (raw||'').slice(0,250), ((raw||'').length / 1024 / 1024).toFixed(4));
|
||||
|
||||
console.log(setTimeout.turn.s.length, 'stacks', parseFloat((-(LT - (LT = +new Date))/1000).toFixed(3)), 'sec', parseFloat(((LT-ST)/1000 / 60).toFixed(1)), 'up', stat.peers||0, 'peers', stat.has||0, 'has');
|
||||
console.log(setTimeout.turn.s.length, 'stacks', parseFloat((-(LT - (LT = +new Date))/1000).toFixed(3)), 'sec', parseFloat(((LT-ST)/1000 / 60).toFixed(1)), 'up', stat.peers||0, 'peers', stat.has||0, 'has', stat.memhused, stat.memused, stat.memax, 'heap mem max');
|
||||
}catch(e){ console.log('DBG err', e) }}
|
||||
|
||||
hear.d += raw.length||0 ; ++hear.c } // STATS!
|
||||
|
@ -16,6 +16,7 @@
|
||||
function check(){
|
||||
var used = util().rss / 1024 / 1024;
|
||||
var hused = heap().used_heap_size / 1024 / 1024;
|
||||
var tmp; if(tmp = console.STAT){ tmp.memax = parseFloat(ev.max.toFixed(1)); tmp.memused = parseFloat(used.toFixed(1)); tmp.memhused = parseFloat(hused.toFixed(1)); }
|
||||
if(hused < ev.max && used < ev.max){ return }
|
||||
//if(used < ev.max){ return }
|
||||
console.STAT && console.STAT('evict memory:', hused.toFixed(), used.toFixed(), ev.max.toFixed());
|
||||
|
Loading…
x
Reference in New Issue
Block a user