Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bd88bde9 authored by Yao Chen's avatar Yao Chen
Browse files

Increase the guardrail limit for memory usage per config

+ Current guardrail for memory usage is too conservative, resulting lots of voluntary data drops
in statsd without trying to send broadcast.

+ Actual data upload size is smaller than the in memory data size. So keep the threshold to send
broadcast but lift the memory usage guardrail to give a chance to send broadcast.

+ Also, make byteSize() estimation less frequent.

Bug: 119773948
Test: statsd_test passes
Change-Id: Ia4c660eb47e6d442c0952628e910b494174279d0
parent 588bdc67
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ public:

    // Max memory allowed for storing metrics per configuration. If this limit is exceeded, statsd
    // drops the metrics data in memory.
    static const size_t kMaxMetricsBytesPerConfig = 256 * 1024;
    static const size_t kMaxMetricsBytesPerConfig = 2 * 1024 * 1024;

    // Soft memory limit per configuration. Once this limit is exceeded, we begin notifying the
    // data subscriber that it's time to call getData.
@@ -130,7 +130,7 @@ public:
    static const int64_t kMinBroadcastPeriodNs = 60 * NS_PER_SEC;

    /* Min period between two checks of byte size per config key in nanoseconds. */
    static const int64_t kMinByteSizeCheckPeriodNs = 10 * NS_PER_SEC;
    static const int64_t kMinByteSizeCheckPeriodNs = 60 * NS_PER_SEC;

    // Maximum age (30 days) that files on disk can exist in seconds.
    static const int kMaxAgeSecond = 60 * 60 * 24 * 30;