/** * Create a striped counters object using <code>numProcessors*2</code> * stripes and the specified <i>batchSize</i>. * * @param batchSize * The values on the instance stripes will be published to the * outer instance every batchSize {@link #release()}s. */ public StripedCounters(final int batchSize) { this(SystemUtil.numProcessors() * 2, batchSize); }
public void testSystemUtil() { System.out.println( "Number of Processors: " + SystemUtil.numProcessors() ); System.out.println( "CPU Info: " + SystemUtil.cpuInfo() ); System.out.println( "Architecture: " + SystemUtil.architecture() ); System.out.println( "Operating System: " + SystemUtil.operatingSystem() ); System.out.println( "OS Version: " + SystemUtil.osVersion() ); assertEquals( SystemUtil.architecture(), System.getProperty( "os.arch" ) ); assertEquals( SystemUtil.operatingSystem(), System.getProperty( "os.name" ) ); assertEquals( SystemUtil.osVersion(), System.getProperty( "os.version" ) ); } }
new OneShotInstrument<Integer>(SystemUtil.numProcessors())); new OneShotInstrument<String>(SystemUtil.cpuInfo()));
/** * Tries each of the methods in this class and returns the PID as reported * by the first method that succeeds. The order in which the methods are * tried SHOULD reflect the likelyhood that the method will get it right. * * @return The PID of this JVM (best guess). */ public static int getPID() { try { if (!SystemUtil.operatingSystem().toLowerCase().startsWith("win")) { return getLinuxPIDWithBash(); } } catch (Throwable t) { log.warn(t); } return getPIDWithRuntimeMXBean(); }
new OneShotInstrument<Integer>(SystemUtil.numProcessors())); new OneShotInstrument<String>(SystemUtil.cpuInfo()));
/** * Tries each of the methods in this class and returns the PID as reported * by the first method that succeeds. The order in which the methods are * tried SHOULD reflect the likelyhood that the method will get it right. * * @return The PID of this JVM (best guess). */ public static int getPID() { try { if (!SystemUtil.operatingSystem().toLowerCase().startsWith("win")) { return getLinuxPIDWithBash(); } } catch (Throwable t) { log.warn(t); } return getPIDWithRuntimeMXBean(); }
/** * Create a striped counters object using <code>numProcessors*2</code> * stripes and the specified <i>batchSize</i>. * * @param batchSize * The values on the instance stripes will be published to the * outer instance every batchSize {@link #release()}s. */ public StripedCounters(final int batchSize) { this(SystemUtil.numProcessors() * 2, batchSize); }
public BigdataTriplePatternMaterializer(final AbstractTripleStore db, final IChunkedOrderedIterator<BigdataTriplePattern> src, final int nthreads) { super(db, src, new BlockingBuffer<ISPO[]>( db.getChunkOfChunksCapacity(), db.getChunkCapacity(), db.getChunkTimeout(), TimeUnit.MILLISECONDS)); if (nthreads < 0) throw new IllegalArgumentException(); // At least 1 thread. At most ncpus*2. this.nthreads = Math.max( Math.min(nthreads, SystemUtil.numProcessors() * 2), 1); }
public BigdataTriplePatternMaterializer(final AbstractTripleStore db, final IChunkedOrderedIterator<BigdataTriplePattern> src, final int nthreads) { super(db, src, new BlockingBuffer<ISPO[]>( db.getChunkOfChunksCapacity(), db.getChunkCapacity(), db.getChunkTimeout(), TimeUnit.MILLISECONDS)); if (nthreads < 0) throw new IllegalArgumentException(); // At least 1 thread. At most ncpus*2. this.nthreads = Math.max( Math.min(nthreads, SystemUtil.numProcessors() * 2), 1); }
props.setProperty("os.arch.cpus", ""+SystemUtil.numProcessors());