advancedScenario-Based & System Design Questions

A service's memory usage climbs steadily until the container is OOM-killed, roughly every 6 hours, regardless of traffic level.

This pattern (steady climb independent of load) points to a memory leak rather than a load-driven capacity issue. Diagnose with heap dumps/profiling tools appropriate to the runtime (e.g., JVM heap analysis for a Spring Boot app) taken at intervals, check for unbounded caches or connection pools that never release resources, and as a stopgap, consider whether a scheduled rolling restart masks the symptom while the actual leak is root-caused — but don't stop at the workaround.

Ready to master this question?

Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.

Sign in to generate a response

Next Step

Continue to After enabling Compose health checks with `depends_on: condition: service_healthy`, the dependent service still occasionally fails to connect to the database on startup.← Back to all Docker questions