Bug 180842 Config memory buffer size in data engine execution.
To tuning the performance, it is necessary for DtE to expose API for clients to config the size of memory it used to store the final result set. A new AppContext string, "org.eclipse.birt.data.cache.memory.size" is proposed. The new appcontext entry only accept positive integer as input, the unit of which would be MB.
data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/executor/cache/SmartCacheHelper.java
rowResultSet = null;
		long consumedTime = ( System.currentTimeMillis( ) - startTime ) / 1000;
		logger.info( "Time consumed by cache is: " + consumedTime + " second" );
	}
	/**
	 * According to avilable memory and specified rsMeta, the max number of rows
	 * which can be cached in memory. There is a potential issue associate with
	 * this value that current DtE is called in only one thread, but in the
	 * future it is probably that DtE is called by multi threads. Then available
	 * memory is shared by all thread, so the cacheSize needs to be adjusted.
	 * 
	 * @param rsMeta
	 * @return row count
	 */
	private long computeCacheMemorySize( IResultClass rsMeta )
	{
		if ( MemoryCacheSize == 0 )
		{
			synchronized ( this )
			{
				if ( MemoryCacheSize == 0 )
				{
					MemoryCacheSize = CacheUtil.computeCacheSize( ) * 1000000;
				}
			}
		}
		return MemoryCacheSize;
	}
}