Optimization of .NET Applications: A Big Result From Small Edits

One old and simple idea runs like a golden thread through this article: Premature optimizations are evil.

Sometimes it happens that optimization and readability go in slightly different directions. Code may work better, but it is harder to read and maintain. And vice versa — code is easy to read and modify but has some performance problems. Therefore, it is important to understand what we are willing to sacrifice in such cases.

How Many Millions of Dollars Do Enterprises Waste Due to Garbage Collection?

We truly believe enterprises are wasting millions of dollars in garbage collection. We equally believe enterprises are wasting these many millions of dollars even without knowing they are wasting. The intent of this post is to bring visibility to how several millions of dollars are wasted due to garbage collection.

What is Garbage?

All applications have a finite amount of memory. When a new request comes, the application creates objects to service the request. Once a request is processed, all the objects created to service that request are no longer needed. In other terms those objects become garbage. They have to be evicted/removed from the memory so that room is created to service new incoming requests.

Java 9 Performance Improvements — Getting Started With Java Spring

In my previous article, I wrote about the Modularity System, which was introduced in Java 9. This was the most major feature of the release, but there are other significant ones which worth to mention. With this writing, I would like to continue the Java evolution line by taking a glance about the main Java 9 features according to the performance improvements.

Java 9 Feature: Performance Improvements

Garbage Collector Deprecations

In Java 9, the most significant performance upgrade was concerned with the Garbage Collection. They introduced a new default one and removed the olds.

How to Tune Garbage Collection in Java

Garbage collection is the mechanism by which the JVM reclaims memory on behalf of the application when it's no longer needed. At a high level, it consists of finding objects that are no longer in use, freeing the memory associated with those objects, and occasionally compacting the heap to prevent memory fragmentation.

The garbage collector performs it's work using one or more threads. But in order to do the job of tracking down object references and moving objects around in memory, it needs to make sure that the application threads are not currently using those objects because if, for example, an application thread is using an object and then the memory location of the object changes due to GC, then bad and unpredictable things could happen. This is why garbage collectors must pause all application threads when performing certain tasks. These pauses are sometimes called Stop-The-World pauses, and the minimization of them is the primary concern of GC tuning, as they can have a huge impact on the performance of a Java application.