What Is the Concurrent Mode Failure?

This is a question that I was asked during an interview: what does the concurrent mode failure means? It’s really a good question to check your understanding of Concurrent Mark Sweep (CMS) Collector. This post starts with concurrent mode failure and explains the whole steps of one CMS cycle. In a nutshell, The message “concurrent mode failure” signifies that the concurrent collection of the Old Generation did not finish before the Old Generation became full. ...

Oct 31, 2018 · 4 min · xgugeng

Java NIO: Selector

Taking FileChannel for example in the previous post may bewilder audiences: it’s non-blocking, so how does NIO achievement non-blocking? Here comes Selector. A Selector is a Java NIO component which can examine one or more NIO Channel’s, and determine which channels are ready for reading or writing. A thread can manage multiply channels with Selector making multiple network connections feasible. This way avoids the cost of switching between threads which is expensive. Here is an illustration of a thread using a Selector to handle 3 Channels: ...

Jul 21, 2018 · 9 min · xgugeng

Java NIO: Channel

Channels are similar to streams available for blocking IO with a few differences: You can both read and write to Channels. Streams are typically one-way (read or write). Channels can be read and written asynchronously. Channels always read to, or write from, a Buffer. The Channels have multiple implementations depending on the data to be read or written: FileChannel: Used to read and write data from and to the files DatagramChannel: Used for data exchange over network using UDP packets SocketChannel: TCP channel to exchange data over TCP sockets ServerSocketChannel: An implementation similar to a web server listening to requests over a specific TCP port. It creates a new SocketChannel instance for every new connection This post will take FileChannel for further exploration, from example to implementation. ...

Jul 19, 2018 · 7 min · xgugeng

Java NIO: Buffer

Java NIO (New IO), introduced by Java 1.4, is an alternative IO API for Java. It offers a different way of working with IO than the standard IO API’s. Three core components of Java NIO cover: Channels Buffers Selectors All IO in NIO involves with Channel. Data can be read from Channel to a Buffer and vice versa. Buffers are used to interact with Channels. A Buffer is an allocated block of memory with fixed size, into which you can read or write data. In this post, I’ll illustrate the basic usage of Buffer and elucidate how it manages to do that from the view of source code. ...

Jul 14, 2018 · 7 min · xgugeng

JVM Series: class File Format

Today, let’s focus on the class file format, the hardware- and operating system-independent binary format used to represent compiled classes and interfaces. A class file consists of a stream of 8-bit bytes. All 16-bit, 32-bit, and 64-bit quantities are constructed by reading in two, four, and eight consecutive 8-bit bytes, respectively. ...

May 17, 2018 · 9 min · xgugeng

JVM Series: Class Loader

The Java Classloader, a part of the Java Runtime Environment, dynamically loads Java classes into the Java Virtual Machine. Each Java class must be loaded by a class loader. ...

Apr 18, 2018 · 5 min · xgugeng

JVM Series: Oop and Klass

As a part of JVM Series, this post tries to explore the object model in JVM. ...

Apr 10, 2018 · 5 min · xgugeng

JVM Series: Overview

When executing a java program, you may simply input in terminal, like: javac HelloWorld.java java HelloWorld Behind these commands, JVM, as the cornerstone of the Java platform, does a lot of work, which are what this blog attempts to figure out. Today, a new series about JVM will be started, and this is the first episode. ...

Jan 9, 2018 · 5 min · xgugeng

JDK Build-in Development Tools

The following documents contain important information you will need to know to get the most out of the JDK tools. ...

Sep 14, 2017 · 5 min · xgugeng

Mind Maps for Java and JVM

These two mind maps are drawn for the further exploration of Java and JVM. For Java I try to cover some advanced features ranging from NIO and Thread. As to JVM, few components are covered, of course, I will replenish it at any moment. ...

Jun 16, 2017 · 1 min · xgugeng