Affected: Java server-side SDK
Symptoms
The following error occurs when your Java application runs out of memory to allocate new objects, which can cause application crashes, unpredictable behavior, and downtime performance:
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "main"
Cause
This issue is commonly caused by large payload sizes. When your application processes payloads that exceed the memory limits allocated by the Java Virtual Machine (JVM), it can trigger memory exhaustion.
Solution
1. Check the size of your raw payload
Use the following curl
command to check the size of your payload. Payloads below 25 MB are recommended.
curl -i -H "Authorization: SDK_KEY" \
https://stream.launchdarkly.com/all
2. If the payload size exceeds 25 MB, follow the steps below:
a. Re-configure flag targeting rules
If your individual targets exceed 10,000, it is recommended to target based on context attributes.
b. Introduce big segments
If you have more than 15,000 entries, implement big segments for better management.