Changeset 3c0ba5c for core


Ignore:
Timestamp:
Jan 1, 2019 3:01:22 PM (17 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
92ad4d1
Parents:
f221e72
Message:

Console: Add warning for OpenJDK Zero VM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/util/SystemVersion.java

    rf221e72 r3c0ba5c  
    3434    private static final boolean _isGentoo = System.getProperty("os.version").contains("gentoo") ||
    3535                                             System.getProperty("os.version").contains("hardened");  // Funtoo
     36    // Could also check for java.vm.info = "interpreted mode"
     37    private static final boolean _isZero = System.getProperty("java.vm.name").contains("Zero");
    3638    private static final boolean _isAndroid;
    3739    private static final boolean _isApache;
     
    7476                          (DAEMON_USER.equals(System.getProperty("user.name")) ||
    7577                           (_isGentoo && GENTOO_USER.equals(System.getProperty("user.name"))));
    76         _isSlow = _isAndroid || _isApache || _isArm || _isGNU || getMaxMemory() < 48*1024*1024L;
     78        _isSlow = _isAndroid || _isApache || _isArm || _isGNU || _isZero || getMaxMemory() < 48*1024*1024L;
    7779
    7880        int sdk = 0;
     
    162164    public static boolean isX86() {
    163165        return _isX86;
     166    }
     167
     168    /**
     169     *  Is this a very slow interpreted mode VM?
     170     *  @since 0.9.38
     171     */
     172    public static boolean isZeroVM() {
     173        return _isZero;
    164174    }
    165175
     
    348358        System.out.println("Wrapper  : " + hasWrapper());
    349359        System.out.println("x86      : " + isX86());
    350 
     360        System.out.println("Zero JVM : " + isZeroVM());
    351361    }
    352362}
Note: See TracChangeset for help on using the changeset viewer.