pcmanus/ccm — pull request #117 by knifewine (2014-05-08 22:20:24+00:00)
Title: dynamically configure node mem environment vars

In some circumstances only 3 nodes can run because they use all
available memory on a system. This is an attempt to make space
for more nodes (particularly on higher mem systems, there's no reason
for 3 nodes to consume 16gb of ram).

This adds an external dependency on psutil, but the benefit
here is we can see cpu count and system memory on linux and windows,
without resorting to custom environment variables.

I basically took a guess at how much memory we should let ccm give to
nodes (70%), but perhaps that's too high. For heap newsize I went at 50%
of the prod recommendation (50mb*cpu count) since we're running leaner
nodes with more modest max heap.

If MAX_HEAP_SIZE or HEAP_NEWSIZE are set they will be left alone.

Running a 32bit jvm may require manually setting MAX_HEAP_SIZE to < 4gb
since this could attempt to allocate more.