
How to Enable Java 9 GC Logs
GC logs are vital artifacts to troubleshoot memory/CPU related problems and optimize applications performance. In Sep 2017, the much-awaited Java 9 was released and GC logging was re-implemented using the

GC logs are vital artifacts to troubleshoot memory/CPU related problems and optimize applications performance. In Sep 2017, the much-awaited Java 9 was released and GC logging was re-implemented using the

It’s not a good idea to read an XML file and store it in a String because it wastes memory. XML specifies its encoding in the XML header, so when

Ideally, when you do not know the data type that you want to store in an array, you can create an Object array and later associate it with the data

Imagine, you want to schedule activating a task few moments (3 seconds in this case) from now, the following code snippet will be helpful. import java.util.*;//We only need Timer and

zero = new Integer(0);return Boolean.valueOf(“true”); Integer and Boolean are immutable; so, it is a bad idea to create objects that represent the same value, those classes have built-in caches for

The new keyword definitely consumes more time when compared to direct initializing the value to a String object. The following illustrates the time consumed by both the mechanisms. These values

Writer w = new OutputStreamWriter(os, “UTF-8”);while (…){ w.write(“something”);} OutputStreamWriter uses memory for each call to its write() methods. This is why it is better to avoid this; if you do

Java provides a very easy mechanism to read jar files. It is the same process used for reading a zip file. The file myFiles.jar contains one or more files (as

In nearly all applications, there is critical data that we would not want anyone to see. Java has an easy way of implementing this. All that is required is to