You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Thomas Boucher <et...@gmail.com> on 2010/09/16 18:00:59 UTC

Pb with memtable_throughput_in_mb?

Hi,

I am trying out the latest trunk version and I get an error when
starting Cassandra with -Xmx3G:
Fatal error: memtable_operations_in_millions must be a positive double

I guess it is caused by line 76 in org/apache/cassandra/config/Config.java [0]:

    public Integer memtable_throughput_in_mb = (int)
Runtime.getRuntime().maxMemory() / 8;

The cast to (int) is done on maxMemory() but this method returns a
long, leading to a cast to a negative integer for mem=3G for instance.
Thus memtable_operations_in_millions becomes negative (Double
memtable_operations_in_millions = memtable_throughput_in_mb / 64 *
0.3) and the exception is thrown:

maxMemory() is measured in bytes but I guess memtable_throughput_in_mb
should in MB (as it names imply), which is not the case here.


What do you think?

Thanks for any input you have to this,
Cheers

[0] http://svn.apache.org/repos/asf/cassandra/trunk/src/java/org/apache/cassandra/config/Config.java

Re: Pb with memtable_throughput_in_mb?

Posted by Brandon Williams <dr...@gmail.com>.
On Thu, Sep 16, 2010 at 11:00 AM, Thomas Boucher <et...@gmail.com> wrote:

> Hi,
>
> I am trying out the latest trunk version and I get an error when
> starting Cassandra with -Xmx3G:
> Fatal error: memtable_operations_in_millions must be a positive double
>
> I guess it is caused by line 76 in org/apache/cassandra/config/Config.java
> [0]:
>
>    public Integer memtable_throughput_in_mb = (int)
> Runtime.getRuntime().maxMemory() / 8;
>
> The cast to (int) is done on maxMemory() but this method returns a
> long, leading to a cast to a negative integer for mem=3G for instance.
> Thus memtable_operations_in_millions becomes negative (Double
> memtable_operations_in_millions = memtable_throughput_in_mb / 64 *
> 0.3) and the exception is thrown:
>
> maxMemory() is measured in bytes but I guess memtable_throughput_in_mb
> should in MB (as it names imply), which is not the case here.
>

Oops, good catch.  Fixed in r997841.

 -Brandon