Changeset 0a83510


Ignore:
Timestamp:
Sep 8, 2011 2:20:19 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
3aa7f19
Parents:
f3521228
Message:
  • Blocklist: Include IP in shitlist reason
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • history.txt

    rf3521228 r0a83510  
     12011-09-08 zzz
     2  * Blocklist: Include IP in shitlist reason
     3  * Ministreaming: Drop old classes replaced by streaming
     4    years ago.
     5  * NTCP: Hopefully fix race NPE, thx devzero
     6  * Tunnels: Limit Bloom filter size based on max memory
     7
    182011-09-07 zzz
    29  * Console: Limit max displayed participating tunnels
     
    714
    8152011-09-06 zzz
    9   * Console: Move configservice.jsp rendering code from
     16  * Console: Move jobs.jsp rendering code from
    1017    the router to the console
    1118  * Crypto: Rework use of SHA256 for efficiency and
  • router/java/src/net/i2p/router/RouterVersion.java

    rf3521228 r0a83510  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 13;
     21    public final static long BUILD = 14;
    2222
    2323    /** for example "-test" */
  • router/java/src/net/i2p/router/tunnel/BloomFilterIVValidator.java

    rf3521228 r0a83510  
    1414 */
    1515public class BloomFilterIVValidator implements IVValidator {
    16     private RouterContext _context;
    17     private DecayingBloomFilter _filter;
    18     private ByteCache _ivXorCache = ByteCache.getInstance(32, HopProcessor.IV_LENGTH);
     16    private final RouterContext _context;
     17    private final DecayingBloomFilter _filter;
     18    private final ByteCache _ivXorCache = ByteCache.getInstance(32, HopProcessor.IV_LENGTH);
    1919   
    2020    /**
     
    2828    private static final int MIN_SHARE_KBPS_FOR_BIG_BLOOM = 512;
    2929    private static final int MIN_SHARE_KBPS_FOR_HUGE_BLOOM = 1536;
     30    private static final long MIN_MEM_TO_USE_BLOOM = 64*1024*1024l;
     31    private static final long MIN_MEM_FOR_BIG_BLOOM = 128*1024*1024l;
     32    private static final long MIN_MEM_FOR_HUGE_BLOOM = 256*1024*1024l;
    3033
    3134    public BloomFilterIVValidator(RouterContext ctx, int KBps) {
    3235        _context = ctx;
    33         // Select the filter based on share bandwidth.
     36        // Select the filter based on share bandwidth and memory.
    3437        // Note that at rates above 512KB, we increase the filter size
    3538        // to keep acceptable false positive rates.
    3639        // See DBF, BloomSHA1, and KeySelector for details.
    37         if (KBps < MIN_SHARE_KBPS_TO_USE_BLOOM)
     40        long maxMemory = Runtime.getRuntime().maxMemory();
     41        if (maxMemory == Long.MAX_VALUE)
     42            maxMemory = 96*1024*1024l;
     43        if (KBps < MIN_SHARE_KBPS_TO_USE_BLOOM || maxMemory < MIN_MEM_TO_USE_BLOOM)
    3844            _filter = new DecayingHashSet(ctx, HALFLIFE_MS, 16, "TunnelIVV"); // appx. 4MB max
    39         else if (KBps >= MIN_SHARE_KBPS_FOR_HUGE_BLOOM)
     45        else if (KBps >= MIN_SHARE_KBPS_FOR_HUGE_BLOOM && maxMemory >= MIN_MEM_FOR_HUGE_BLOOM)
    4046            _filter = new DecayingBloomFilter(ctx, HALFLIFE_MS, 16, "TunnelIVV", 25);  // 8MB fixed
    41         else if (KBps >= MIN_SHARE_KBPS_FOR_BIG_BLOOM)
     47        else if (KBps >= MIN_SHARE_KBPS_FOR_BIG_BLOOM && maxMemory >= MIN_MEM_FOR_BIG_BLOOM)
    4248            _filter = new DecayingBloomFilter(ctx, HALFLIFE_MS, 16, "TunnelIVV", 24);  // 4MB fixed
    4349        else
Note: See TracChangeset for help on using the changeset viewer.