public RecordManager createRecordManager( String name,
                                              Properties options )
        throws IOException
    {

        RecordManager recman = new BaseRecordManager( name );

        String value = options.getProperty( RecordManagerOptions.DISABLE_TRANSACTIONS, "false" );
        if ( value.equalsIgnoreCase( "TRUE" ) ) {
            ( (BaseRecordManager) recman ).disableTransactions();
        }

        value = options.getProperty(RecordManagerOptions.COMPRESS,"false");
        boolean compress = value.equalsIgnoreCase("TRUE"); 
        if(compress)
        	( (BaseRecordManager) recman ).setCompress(true);
        
        String cacheType = options.getProperty( RecordManagerOptions.CACHE_TYPE, "auto" );

        value = options.getProperty( RecordManagerOptions.CACHE_SIZE, "1000" );
        int cacheSize = Integer.parseInt( value );

        if("auto".equals(cacheType)){
        	try{
        		//disable SOFT if available memory is bellow 50 MB
        		if(Runtime.getRuntime().maxMemory()<=50000000)  
        			cacheType = "mru";
        		else
        			cacheType = "soft";
        	}catch(Exception e){
        		cacheType = "mru";
        	}
        }
        	
        if ("mru".equals(cacheType)) {
        	if(cacheSize>0){                	
        		recman = new CacheRecordManager( recman,cacheSize,false);
        	}
        }else if ("soft".equals(cacheType)) {
        	recman = new CacheRecordManager(recman, cacheSize, true); 
        }else if ("none".equals(cacheType)) {
        	//do nothing
        }else{
        	throw new IllegalArgumentException("Unknown cache type: "+cacheType);
        }
        
        return recman;
    }