Changeset e614b099 for router


Ignore:
Timestamp:
Nov 8, 2016 3:42:22 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
e5bcfe4
Parents:
b559b41
Message:

Router: Fix low-memory log messages for non-wrapper (ticket #1795)
Install: Add max memory option to runplain.sh
Build: Fix minimum Java version for Windows

Location:
router/java/src/net/i2p/router
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/tasks/OOMListener.java

    rb559b41 re614b099  
    5050            log.log(Log.CRIT, "free mem: " + Runtime.getRuntime().freeMemory() +
    5151                              " total mem: " + Runtime.getRuntime().totalMemory());
     52            // Can't find any System property or wrapper property that gives
     53            // you the actual config file path, have to guess
     54            String path;
     55            if (SystemVersion.isLinuxService()) {
     56                path = "/etc/i2p";
     57            } else {
     58                path = _context.getBaseDir().toString();
     59            }
    5260            if (_context.hasWrapper()) {
    53                 // Can't find any System property or wrapper property that gives
    54                 // you the actual config file path, have to guess
    55                 String path;
    56                 if (SystemVersion.isLinuxService()) {
    57                     path = "/etc/i2p";
    58                 } else {
    59                     path = _context.getBaseDir().toString();
    60                 }
    6161                log.log(Log.CRIT, "To prevent future shutdowns, increase wrapper.java.maxmemory in " +
     62                                  path + File.separatorChar + "wrapper.config");
     63            } else if (!SystemVersion.isWindows()) {
     64                log.log(Log.CRIT, "To prevent future shutdowns, increase MAXMEMOPT in " +
     65                                  path + File.separatorChar + "runplain.sh or /usr/bin/i2prouter-nowrapper");
     66            } else {
     67                log.log(Log.CRIT, "To prevent future shutdowns, run the restartable version of I2P, and increase wrapper.java.maxmemory in " +
    6268                                  path + File.separatorChar + "wrapper.config");
    6369            }
  • router/java/src/net/i2p/router/tunnel/BloomFilterIVValidator.java

    rb559b41 re614b099  
    105105        // Can't find any System property or wrapper property that gives
    106106        // you the actual config file path, have to guess
    107         // TODO if !SystemVersion.hasWrapper ...
    108107        String path;
    109108        if (SystemVersion.isLinuxService()) {
     
    115114            "Configured for " + DataHelper.formatSize(KBps *1024L) +
    116115            "Bps share bandwidth but only " +
    117             DataHelper.formatSize(maxMemory) + "B available memory." +
    118             " Recommend increasing wrapper.java.maxmemory in " +
    119             path + File.separatorChar + "wrapper.config" +
    120             // getMaxMemory() returns significantly lower than wrapper config, so add 10%
    121             " to at least " + (recMaxMem * 11 / 10 / (1024*1024)) + " (MB)" +
    122             " if the actual share bandwidth exceeds " +
    123             DataHelper.formatSize(threshKBps * 1024L) + "Bps.";
     116            DataHelper.formatSize(maxMemory) + "B available memory.";
     117        if (_context.hasWrapper()) {
     118            msg += " Recommend increasing wrapper.java.maxmemory in " +
     119                   path + File.separatorChar + "wrapper.config";
     120        } else if (!SystemVersion.isWindows()) {
     121            msg += " Recommend increasing MAXMEMOPT in " +
     122                   path + File.separatorChar + "runplain.sh or /usr/bin/i2prouter-nowrapper";
     123        } else {
     124            msg += " Recommend running the restartable version of I2P, and increasing wrapper.java.maxmemory in " +
     125                   path + File.separatorChar + "wrapper.config";
     126        }
     127        // getMaxMemory() returns significantly lower than wrapper config, so add 10%
     128        msg += " to at least " + (recMaxMem * 11 / 10 / (1024*1024)) + " (MB)" +
     129               " if the actual share bandwidth exceeds " +
     130               DataHelper.formatSize(threshKBps * 1024L) + "Bps.";
    124131        System.out.println("WARN: " + msg);
    125132        _context.logManager().getLog(BloomFilterIVValidator.class).logAlways(Log.WARN, msg);
Note: See TracChangeset for help on using the changeset viewer.