By default, GemFire keeps the last 1,000 transactions in memory for HA purposes. Hence, if there are many updates to data entries in each transactions, GemFire can consume a large amount of Java heap memory in order to keep all those updates. This, in turn, may lead to an OutOfMemoryError situation when this memory usage behavior is not considered.
This article discusses how to manage memory usage for GemFire transactions.
You can configure how many past transactions GemFire keeps in memory by specifying the following Java system property when starting your GemFire cache:
-Dgemfire.transactionFailoverMapSize=[number of committed-transactions]
If you are experiencing an OutOfMemorySituation because of memory usage from GemFire transactions, you should reduce this number to something less than the default value of 1,000, e.g.:
-Dgemfire.transactionFailoverMapSize=100
However, when GemFire members crashed during processing of many concurrent transactions, lowering this value increases the possibility that transactions could be lost.
Alternatively, you may increase this value to support very large numbers of concurrent transactions.
If you start your cache servers with gfsh
, you can specify this Java system property as follows:
gfsh start server ... --J=-Dgemfire.transactionFailoverMapSize=100
Applies To
GemFire 6.6 or later