Author: schor Date: Tue Feb 16 15:58:58 2016 New Revision: 1730706 URL: http://svn.apache.org/viewvc?rev=1730706&view=rev Log: [UIMA-4674] restore APIs that pass in the initial heap size (used internally to presize some data structures)
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/util/CasCreationUtils.java Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/util/CasCreationUtils.java URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/util/CasCreationUtils.java?rev=1730706&r1=1730705&r2=1730706&view=diff ============================================================================== --- uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/util/CasCreationUtils.java (original) +++ uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/util/CasCreationUtils.java Tue Feb 16 15:58:58 2016 @@ -563,6 +563,18 @@ public class CasCreationUtils { throw new ResourceInitializationException(e); } + // get initial heap size + String initialHeapSizeStr = null; + if (aPerformanceTuningSettings != null) { + initialHeapSizeStr = aPerformanceTuningSettings + .getProperty(UIMAFramework.CAS_INITIAL_HEAP_SIZE); + } + + int initialHeapSize = (null == initialHeapSizeStr) + ? CASImpl.DEFAULT_INITIAL_HEAP_SIZE + : Integer.parseInt(initialHeapSizeStr); + + // Check Jcas cache performance setting. Defaults to true. boolean useJcasCache = true; if (aPerformanceTuningSettings != null) { @@ -576,7 +588,7 @@ public class CasCreationUtils { // create CAS using either aTypeSystem or aTypeSystemDesc CASMgr casMgr; if (aTypeSystem != null) { - casMgr = CASFactory.createCAS(aTypeSystem, useJcasCache); + casMgr = CASFactory.createCAS(initialHeapSize, aTypeSystem, useJcasCache); // Set JCas ClassLoader - before setupTypeSystem if (aResourceManager.getExtensionClassLoader() != null) {