Diagnosing memory leaks in Java applications

Despite being a garbage-collected language, memory leaks are still possible (and quite common) in Java. The simplest example is an in-memory data structure that grows with every unit of work performed by the system. For example, imagine you store an in-memory log for every request/response you process, and never bound the size or flush to disk. Some other examples include: File leaks, where a file or socket is not closed. These consume both memory and OS file handles and will eventually fail....

July 1, 2023 · 5 min · Gautam Raj

Java performance profiling

For me, one of the most fun parts of software development is making software run as fast as possible. Performance tuning has very simple objective metrics - maximize throughput, minimize latency and compute cost. It can sometimes require detective work and intuition to understand where a bottleneck might be coming from. Fortunately, there is some excellent tooling for the JVM which I’ll talk about here. Performance is a very broad topic, so for this post I’ll focus on CPU bottlenecks....

May 4, 2023 · 3 min · Gautam Raj