Thumbtack Jul 17, 2025

Debugging OOMs: SQLite Query Optimization

Article Summary

Brian Terczynski from Thumbtack tracked down a brutal Android OOM bug that was crashing apps at startup—and the culprit wasn't a memory leak. It was hiding in plain sight: their SQLite queries.

Thumbtack's Android team faced mysterious OutOfMemory crashes that left no obvious traces. Traditional debugging tools like Leak Canary and Android Studio Profiler found nothing. The breakthrough came from examining alternate thread stack traces and discovering users with massive event log backlogs.

Key Takeaways

Critical Insight

Switching from in-memory list operations to proper SQL queries (COUNT and LIMIT) eliminated 90%+ of OOM crashes and dramatically improved crash-free user rates.

The article reveals why the team's event logging system was silently accumulating data and how a simple SQL optimization saved their crash metrics.

Recent from Thumbtack

Related Articles