hopefully increases limits?

This commit is contained in:
Mark Nadal 2020-01-22 06:56:57 -08:00
parent b5fd757db4
commit ba2b207dd6
4 changed files with 11 additions and 5 deletions

2
gun.js
View File

@ -619,7 +619,7 @@
var Type = USE('./type');
function Dup(opt){
var dup = {s:{}};
opt = opt || {max: 1000, age: /*1000 * 9};//*/ 1000 * 9 * 3};
opt = opt || {max: 1000, age: /*1000 * 9};//*/ 1000 * 60 * 2};
dup.check = function(id){ var tmp;
if(!(tmp = dup.s[id])){ return false }
if(tmp.pass){ return tmp.pass = false }

View File

@ -16,7 +16,8 @@
function check(){
var used = util().rss / 1024 / 1024;
var hused = heap().used_heap_size / 1024 / 1024;
if(hused < ev.max && used < ev.max){ return }
//if(hused < ev.max && used < ev.max){ return }
if(used < ev.max){ return }
console.LOG && Gun.log('evict memory:', hused.toFixed(), used.toFixed(), ev.max.toFixed());
GC();//setTimeout(GC, 1);
}
@ -28,7 +29,7 @@
if(--toss < 0){ return }
root.gun.get(soul).off();
});
root.dup.drop(1000 * 9); // clean up message tracker
root.dup.drop(1000 * 45); // clean up message tracker
}
/*
root.on('in', function(msg){

View File

@ -2,7 +2,7 @@
var Gun = require('../gun'), u;
Gun.serve = require('./serve');
//process.env.GUN_ENV = process.env.GUN_ENV || 'debug';
//console.LOG = true; // only do this for dev.
console.LOG = true; // only do this for dev.
Gun.on('opt', function(root){
if(u === root.opt.super){ root.opt.super = true }
if(u === root.opt.faith){ root.opt.faith = true } // HNPERF: This should probably be off, but we're testing performance improvements, please audit.

View File

@ -79,11 +79,16 @@ Gun.on('create', function(root){
}
if(has['-'] || (soul||{})['-']){ o.reverse = true }
if((tmp = (root.next||empty)[soul]) && tmp.put){
var SPUT = tmp.put;
if(o.atom){
tmp = (tmp.next||empty)[o.atom] ;
if(tmp && tmp.rad){ return }
if(tmp && tmp.rad){
LOG && Gun.log("still cached atom", JSON.stringify(get), Object.keys(SPUT||{}).length);
return;
}
} else
if(tmp && tmp.rad){
LOG && Gun.log("still cached", JSON.stringify(get), Object.keys(SPUT||{}).length);
return;
}
}