DataStorageConfiguration
instead.@Deprecated public class MemoryConfiguration extends Object implements Serializable
getPageSize()
. An individual page can store one or many cache key-value entries
that allows reusing the memory in the most efficient way and avoid memory fragmentation issues.
By default, the page memory allocates a single expandable memory region using settings of
createDefaultPolicyConfig()
. All the caches that will be configured in an application
will be mapped to this memory region by default, thus, all the cache data will reside in that memory region.
If initial size of the default memory region doesn't satisfy requirements or it's required to have multiple memory
regions with different properties then MemoryPolicyConfiguration
can be used for both scenarios.
For instance, using memory policies you can define memory regions of different maximum size, eviction policies,
swapping options, etc. Once you define a new memory region you can bind particular Ignite caches to it.
To learn more about memory policies refer to MemoryPolicyConfiguration
documentation.
Sample configuration below shows how to make 5 GB memory regions the default one for Apache Ignite:
<property name="memoryConfiguration">
<bean class="org.apache.ignite.configuration.MemoryConfiguration">
<property name="systemCacheInitialSize" value="#{100L * 1024 * 1024}"/>
<property name="defaultMemoryPolicyName" value="default_mem_plc"/>
<property name="memoryPolicies">
<list>
<bean class="org.apache.ignite.configuration.MemoryPolicyConfiguration">
<property name="name" value="default_mem_plc"/>
<property name="initialSize" value="#{5L * 1024 * 1024 * 1024}"/>
</bean>
</list>
</property>
</bean>
</property>
Modifier and Type | Field and Description |
---|---|
static String |
DFLT_MEM_PLC_DEFAULT_NAME
Deprecated.
This name is assigned to default DataRegion if no user-defined default MemPlc is specified
|
static long |
DFLT_MEMORY_POLICY_INITIAL_SIZE
Deprecated.
Default memory policy start size (256 MB).
|
static long |
DFLT_MEMORY_POLICY_MAX_SIZE
Deprecated.
Default memory policy's size is 20% of physical memory available on current machine.
|
static int |
DFLT_PAGE_SIZE
Deprecated.
Default memory page size.
|
Constructor and Description |
---|
MemoryConfiguration()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
MemoryPolicyConfiguration |
createDefaultPolicyConfig()
Deprecated.
Creates a configuration for the default memory policy that will instantiate the default memory region.
|
int |
getConcurrencyLevel()
Deprecated.
Returns the number of concurrent segments in Ignite internal page mapping tables.
|
String |
getDefaultMemoryPolicyName()
Deprecated.
Gets a name of default memory policy.
|
long |
getDefaultMemoryPolicySize()
Deprecated.
Gets a size for default memory policy overridden by user.
|
MemoryPolicyConfiguration[] |
getMemoryPolicies()
Deprecated.
Gets an array of all memory policies configured.
|
int |
getPageSize()
Deprecated.
The pages memory consists of one or more expandable memory regions defined by
MemoryPolicyConfiguration . |
long |
getSystemCacheInitialSize()
Deprecated.
Initial size of a memory region reserved for system cache.
|
long |
getSystemCacheMaxSize()
Deprecated.
Maximum memory region size reserved for system cache.
|
MemoryConfiguration |
setConcurrencyLevel(int concLvl)
Deprecated.
Sets the number of concurrent segments in Ignite internal page mapping tables.
|
MemoryConfiguration |
setDefaultMemoryPolicyName(String dfltMemPlcName)
Deprecated.
Sets the name for the default memory policy that will initialize the default memory region.
|
MemoryConfiguration |
setDefaultMemoryPolicySize(long dfltMemPlcSize)
Deprecated.
Overrides size of default memory policy which is created automatically.
|
MemoryConfiguration |
setMemoryPolicies(MemoryPolicyConfiguration... memPlcs)
Deprecated.
Sets memory policies configurations.
|
MemoryConfiguration |
setPageSize(int pageSize)
Deprecated.
Changes the page size.
|
MemoryConfiguration |
setSystemCacheInitialSize(long sysCacheInitSize)
Deprecated.
Sets initial size of a memory region reserved for system cache.
|
MemoryConfiguration |
setSystemCacheMaxSize(long sysCacheMaxSize)
Deprecated.
Sets maximum memory region size reserved for system cache.
|
String |
toString()
Deprecated.
|
public static final long DFLT_MEMORY_POLICY_INITIAL_SIZE
public static final long DFLT_MEMORY_POLICY_MAX_SIZE
public static final int DFLT_PAGE_SIZE
public static final String DFLT_MEM_PLC_DEFAULT_NAME
public long getSystemCacheInitialSize()
public MemoryConfiguration setSystemCacheInitialSize(long sysCacheInitSize)
DFLT_SYS_CACHE_INIT_SIZE
sysCacheInitSize
- Size in bytes.this
for chaining.public long getSystemCacheMaxSize()
public MemoryConfiguration setSystemCacheMaxSize(long sysCacheMaxSize)
sysCacheMaxSize
- Maximum size in bytes for system cache memory region.this
for chaining.public int getPageSize()
MemoryPolicyConfiguration
.
Every memory region is split on pages of fixed size that store actual cache entries.public MemoryConfiguration setPageSize(int pageSize)
DFLT_PAGE_SIZE
pageSize
- Page size in bytes.public MemoryPolicyConfiguration[] getMemoryPolicies()
CacheConfiguration.setMemoryPolicyName(String)
method.public MemoryConfiguration setMemoryPolicies(MemoryPolicyConfiguration... memPlcs)
memPlcs
- Memory policies configurations.public MemoryPolicyConfiguration createDefaultPolicyConfig()
setMemoryPolicies(MemoryPolicyConfiguration...)
method and change the name of the
default memory policy with setDefaultMemoryPolicyName(String)
.public int getConcurrencyLevel()
public MemoryConfiguration setConcurrencyLevel(int concLvl)
concLvl
- Mapping table concurrency level.public long getDefaultMemoryPolicySize()
DFLT_MEMORY_POLICY_MAX_SIZE
if nothing was specified.public MemoryConfiguration setDefaultMemoryPolicySize(long dfltMemPlcSize)
dfltMemPlcSize
- Size of default memory policy overridden by user.public String getDefaultMemoryPolicyName()
MemoryConfiguration
or null
of the
default policy is used.public MemoryConfiguration setDefaultMemoryPolicyName(String dfltMemPlcName)
setMemoryPolicies(MemoryPolicyConfiguration...)
method and change the name of the
default memory policy with MemoryConfiguration#setDefaultMemoryPolicyName(String)
.
If nothing is specified by user, it is set to DFLT_MEM_PLC_DEFAULT_NAME
value.dfltMemPlcName
- Name of a memory policy to be used as default one.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.2 Release Date : February 6 2019