Changeset e614b099


Ignore:
Timestamp:
Nov 8, 2016 3:42:22 PM (3 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

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • installer/i2pinstaller.xml

    rb559b41 re614b099  
    88  <icon>resources/console.ico</icon>
    99  <jre>
    10     <minVersion>1.6.0</minVersion>
     10    <minVersion>1.7.0</minVersion>
    1111  </jre>
    1212  <!--
  • installer/i2pstandalone.xml

    rb559b41 re614b099  
    88  <icon>resources/start.ico</icon>
    99  <jre>
    10     <minVersion>1.6.0</minVersion>
     10    <minVersion>1.7.0</minVersion>
    1111    <!--
    1212    <minHeapSize>64</minHeapSize>
  • installer/resources/runplain.sh

    rb559b41 re614b099  
    44# This means the router will not restart if it crashes.
    55# Also, you will be using the default memory size, which is
    6 # probably not enough for i2p.
     6# probably not enough for i2p, unless you set it below.
    77# You should really use the i2prouter script instead.
    88#
     
    1919PREFERv4="false"
    2020CP=
     21
     22# Uncomment to set the maximum memory. The default and the option may vary in different JVMs.
     23# Check your java documentation to be sure.
     24#MAXMEMOPT="-Xmx256m"
    2125
    2226# Try using the Java binary that I2P was installed with.
     
    4044    export JAVA_TOOL_OPTIONS="-Djava.awt.headless=true"
    4145fi
    42 JAVAOPTS="-Djava.net.preferIPv4Stack=${PREFERv4} -Djava.library.path=${I2P}:${I2P}/lib -Di2p.dir.base=${I2P} -DloggerFilenameOverride=logs/log-router-@.txt"
     46JAVAOPTS="${MAXMEMOPT} -Djava.net.preferIPv4Stack=${PREFERv4} -Djava.library.path=${I2P}:${I2P}/lib -Di2p.dir.base=${I2P} -DloggerFilenameOverride=logs/log-router-@.txt"
    4347(
    4448    nohup ${JAVA} -cp \"${CP}\" ${JAVAOPTS} net.i2p.router.RouterLaunch > /dev/null 2>&1
  • 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.