Package org.apache.directmemory.memory.allocator

Examples of org.apache.directmemory.memory.allocator.MergingByteBufferAllocator$LinkedByteBuffer


        used.set( 0 );
    }

    protected Allocator instanciateByteBufferAllocator( final int allocatorNumber, final int size )
    {
        final MergingByteBufferAllocator allocator = new MergingByteBufferAllocator( allocatorNumber, size );

        // Hack to ensure the pointers are always split to keep backward compatibility.
        allocator.setMinSizeThreshold( 0 );
        allocator.setSizeRatioThreshold( 1.0 );

        return allocator;
    }
View Full Code Here


        logger.info( "************************************************" );
    }
   
    public void rawInsert( int megabytes, int howMany )
    {
        Allocator allocator = new MergingByteBufferAllocator( 1, megabytes * 1024 * 1024 );
        assertNotNull( allocator );
        int size = allocator.getCapacity() / ( howMany );
        size -= size / 100 * 1;
        logger.info( "payload size=" + size );
        logger.info( "entries=" + howMany );

        logger.info( "starting..." );

        long start = System.currentTimeMillis();

        for ( int i = 0; i < howMany; i++ )
        {
            allocator.allocate( size );
        }

        logger.info( "...done in " + ( System.currentTimeMillis() - start ) + " msecs." );
        logger.info( "---------------------------------" );
        dump( allocator );
View Full Code Here

TOP

Related Classes of org.apache.directmemory.memory.allocator.MergingByteBufferAllocator$LinkedByteBuffer

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.