Elffuss BraidHub

kikocis/java-driver public

Reserve extra slot to relax memory pressure from running CCM clusters.
Changeset78f817fd23f6904a5ba0f39f9b7cd0294601512de08f6fa2ff834e5d87d3db59
AuthorAndrew Tolbert <andrew.tolbert@datastax.com> · 2016-04-29 14:49 -05:00
CommitterAndrew Tolbert <andrew.tolbert@datastax.com> · 2016-04-29 14:49 -05:00
Parents67bdb486c55a

Browse the files at this changeset

1 file changed

modified driver-core/src/test/java/com/datastax/driver/core/CCMCache.java +3 −3
@@ -271,10 +271,10 @@
271271 // CCM nodes are started with -Xms500M -Xmx500M
272272 // and allocate up to 100MB non-heap memory in the general case,
273273 // to be conservative we treat 1 "slot" as 800Mb.
274- // We leave 2 slots out to avoid starving system memory,
274+ // We leave 3 slots out to avoid starving system memory,
275275 // and we pick a value with a minimum of 1 slot and a maximum of 8 slots.
276- // For example, an 8GB VM with ~6.5GB currently available heap will yield 6 slots ((6500/800) - 2 = 6).
277- long slotsAvailable = (freeMemoryMB / ONE_CCM_NODE_MB) - 2;
276+ // For example, an 8GB VM with ~6.5GB currently available heap will yield 5 slots ((6500/800) - 3 = 5).
277+ long slotsAvailable = (freeMemoryMB / ONE_CCM_NODE_MB) - 3;
278278 maximumWeight = Math.min(8, Math.max(1, slotsAvailable));
279279 } else {
280280 maximumWeight = Integer.parseInt(numberOfNodes);