mirror of
https://github.com/corda/corda.git
synced 2025-02-20 09:26:41 +00:00
DEFAULT_MAX_BUCKETS based on max heap size
MAX_DEFAULT_BUCKETS is linearly correlated to max heap size with a minimum of 256 buckets.
This commit is contained in:
parent
391270ed71
commit
5966610a6e
@ -21,11 +21,12 @@ import kotlin.system.measureTimeMillis
|
||||
|
||||
/**
|
||||
* The default maximum size of the LRU cache.
|
||||
* Current computation is linear to max heap size, ensuring a minimum of 256 buckets.
|
||||
*
|
||||
* TODO: make this value configurable
|
||||
* TODO: tune this value, as it's currently mostly a guess
|
||||
*/
|
||||
val DEFAULT_MAX_BUCKETS = 4096
|
||||
val DEFAULT_MAX_BUCKETS = (256 * (1 + Math.max(0, (Runtime.getRuntime().maxMemory()/1000000 - 128) / 64))).toInt()
|
||||
|
||||
/**
|
||||
* A convenient JDBC table backed hash map with iteration order based on insertion order.
|
||||
|
Loading…
x
Reference in New Issue
Block a user