Big-O Ambiguity

Back to University Most people talk about Big-O notation when it comes to runtime and space complexity. But when you recall your first year at university, most probably you had Algorithm and Data Structure course when you have learned not only Big-O notation, but also Big-Ω (Omega) and Big-Θ (Theta). Here is a very brief definition:  …

Read more...

Ring Buffer – a Data Structure Behind Disruptor

Disruptor is a high-performance library for passing messages between threads, developed and open sourced some years ago by LMAX Exchange company.  They created this piece of software to handle an enormous traffic (more than 6 million TPS) in their retail financial trading platform. In 2010 they surprised everyone how fast their system can be by…

Read more...

A Tale of Two Iterators

When you look at the most popular Java interview questions, you might encounter the one about fail-fast and fail-safe iterators: What’s the difference between fail-fast and fail-safe iterators? The simplified answer is that: Fail-fast iterator throws ConcurrentModificationException if the collection is modified while iterating, but fail-safe doesn’t. Even though it totally makes sense, it’s not…

Read more...

Tail-Tolerance by Google

Recently, I have read an interesting paper entitled “The Tail at Scale” written by two experts from Google: Jeff Dean and Luiz Barroso. The authors defined what the latency tail-tolerant system is and how to implement it.   Tail Latency What is Tail Latency? In the paper, the authors provide an example of the system where…

Read more...

When Throughput Matters – Parallel GC

As I mentioned in one of the previous posts, Parallel Collector is also called Throughput Collector, because its main goal is to maximize overall throughput of the application. The two basic operations that Parallel Collector performs are Minor GC and Full GC. These are pretty straightforward.   Minor GC When Eden fills up, the young…

Read more...

User, Sys and Real Times in GC Log

Have you ever wondered what user, sys and real times in a GC log mean? Well, I have, a couple of times at least. Let’s say that we have the following line after Full GC entry: [Times: user=4.21 sys=0.03, real=0.75 secs] To find out what they represent, we should check UNIX command time first. time…

Read more...

Shallow, Retained and Deep Size

If you ever worked with heap analysis, you might have encountered terms such as shallow, retained and deep size of an object. It doesn’t really matter if we’re talking about analyzing JVM heap dump with VisualVM or JavaScript heap snapshot with Chrome DevTools – the terms are the same. The difference between shallow, retained and…

Read more...