cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Branimir Lambov (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-7926) Stress can OOM on merging of timing samples
Date Wed, 24 Sep 2014 14:49:33 GMT


Branimir Lambov commented on CASSANDRA-7926:

Looks good, if we're OK with having somewhat fewer than maxSamples samples a lot of the time.
Otherwise you could use a variation of the [reservoir sampling method|].

In Timer constructor, for calculating an upper bound for the power of 2 for a given sample
size you can use
{panel}ceil(log2\(x\)) = 32 - numberOfLeadingZeros(x - 1){panel}
(from the [java documentation|]).

The changes to FasterRandom probably weren't intended to be uploaded? I don't see them used
anywhere in the patch. (Note: nextDouble returns a value in [-1, 1), it should use >>>
11 instead of >> 12.)

> Stress can OOM on merging of timing samples
> -------------------------------------------
>                 Key: CASSANDRA-7926
>                 URL:
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Benedict
>            Assignee: Benedict
>            Priority: Minor
>              Labels: tools
>             Fix For: 2.1.1
> {noformat}
> Exception in thread "StressMetrics:2" java.lang.OutOfMemoryError: Java heap space
>         at java.util.Arrays.copyOf(
>         at org.apache.cassandra.stress.util.SampleOfLongs.merge(
>         at org.apache.cassandra.stress.util.TimingInterval.merge(
>         at org.apache.cassandra.stress.util.Timing.snapInterval(
>         at org.apache.cassandra.stress.StressMetrics.update(
>         at org.apache.cassandra.stress.StressMetrics.access$200(
>         at org.apache.cassandra.stress.StressMetrics$
>         at
> {noformat}
> This is partially down to recently increasing the per-thread sample size, but also because
we allocate temporary space linear in size to total sample size in all threads during merge.
This can easily be avoided. We should also scale per-thread sample size based on total number
of threads, so we limit total memory use.

This message was sent by Atlassian JIRA

View raw message