Random: Reduce number of PRNG buffers

This commit is contained in:
zzz
2016-01-22 16:43:29 +00:00
parent a4f75d7b32
commit cf3accb181

View File

@@ -120,7 +120,8 @@ public class RouterContext extends I2PAppContext {
// or about 2 seconds per buffer - so about 200x faster
// to fill than to drain - so we don't need too many
long maxMemory = SystemVersion.getMaxMemory();
long buffs = Math.min(16, Math.max(2, maxMemory / (14 * 1024 * 1024)));
long maxBuffs = (SystemVersion.isAndroid() || SystemVersion.isARM()) ? 4 : 8;
long buffs = Math.min(maxBuffs, Math.max(2, maxMemory / (21 * 1024 * 1024)));
envProps.setProperty("prng.buffers", "" + buffs);
}
return envProps;