Package org.jboss.netty.util

Examples of org.jboss.netty.util.ObjectSizeEstimator


        // threads max
        // int maxThreads = Runtime.getRuntime().availableProcessors() *2 + 1;
        int maxThreads = 5;
        // Memory limitation: 1MB by channel, 1GB global, 100 ms of timeout
        ThreadPoolExecutor pipelineExecutor = new OrderedMemoryAwareThreadPoolExecutor(maxThreads, 1048576, 1073741824,
                100, TimeUnit.MILLISECONDS, new ObjectSizeEstimator() {
                  @Override
                  public int estimateSize(Object o) {
                     return 1000;
                  }
               }, Executors.defaultThreadFactory());
View Full Code Here


     *
     * We could get more fancy later ...
     */
    private static ObjectSizeEstimator sizeEstimator()
    {
        return new ObjectSizeEstimator()
        {
            public int estimateSize(Object o)
            {
                return 1;
            }
View Full Code Here

     *
     * We could get more fancy later ...
     */
    private static ObjectSizeEstimator sizeEstimator()
    {
        return new ObjectSizeEstimator()
        {
            public int estimateSize(Object o)
            {
                return 1;
            }
View Full Code Here

        // threads max
        // int maxThreads = Runtime.getRuntime().availableProcessors() *2 + 1;
        int maxThreads = 5;
        // Memory limitation: 1MB by channel, 1GB global, 100 ms of timeout
        ThreadPoolExecutor pipelineExecutor = new OrderedMemoryAwareThreadPoolExecutor(maxThreads, 1048576, 1073741824, 100,
                TimeUnit.MILLISECONDS, new ObjectSizeEstimator() {
                    @Override
                    public int estimateSize(Object o) {
                        return 1000;
                    }
                }, Executors.defaultThreadFactory());
View Full Code Here

TOP

Related Classes of org.jboss.netty.util.ObjectSizeEstimator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.