Skip to content

Commit 9daf3ee

Browse files
committed
fix(flags): document exposure cache capacity
1 parent 62c8965 commit 9daf3ee

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

features/dd-sdk-android-flags/src/main/kotlin/com/datadog/android/flags/internal/ExposureEventsProcessor.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ internal class ExposureEventsProcessor(private val writer: RecordWriter, private
8989
}
9090

9191
companion object {
92-
// Maximum cache size in bytes (8MB)
93-
private const val MAX_CACHE_SIZE_BYTES = 8 * 1024 * 1024 // 8MB
92+
// Maximum cache size in bytes (4MB). The expected high-water mark is
93+
// two subjects with 2,500 flags each, which is about 2.8-3.8MB when
94+
// identifiers average 200-300 combined characters per cache entry.
95+
private const val MAX_CACHE_SIZE_BYTES = 4 * 1024 * 1024 // 4MB
9496

9597
// Memory overhead constants for size calculation
9698
private const val OBJECT_OVERHEAD = 16 // bytes for object header

0 commit comments

Comments
 (0)