This commit is contained in:
Mark Nadal 2020-09-19 21:07:09 -07:00
parent f10f7e5118
commit 4b0f0f3538
2 changed files with 2 additions and 1 deletions

2
gun.js
View File

@ -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!

View File

@ -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());