Blog Archives

Java String & Array limitations and OutOfMemoryError

Q1. What is the maximum possible length of a Java String & how much heap space do you need to store the maximum possible String object? A1. A Java String internally uses a char array (i.e. char[]) and the indices of an array is an integer. The maximum value of

Read more ›

Posted in Exception Handling, Memory Management

02: jvisualvm to detect memory leak – a quick tutorial style Java demo

This is a companion post to 8 Java Memory Management Interview Q&A demonstrating a memory leak scenario step by step with jvisualvm, which is a free profiling tool that gets shipped with JDK. Step 1: Code that causes memory leak Here is a sample code that causes memory leak. It

Read more ›

Posted in jvisualvm profiling, JVM, Memory Management

01: jvisualvm to sample Java heap memory

Java does not have a sizeof operator like C++ does. Java uses automatic memory management known as the Garbage Collection, hence it is not that important to evaluate size of various objects. But, for the purpose of learning & fixing any potential memory issues, I have used “jvisualvm”, which is

Read more ›

Posted in jvisualvm profiling, JVM, Memory Management

javap, jps, jmap, and jvisualvm tutorial – analyzing the heap histogram

Q1. Is there anything wrong with the code snippet shown below?

A1. The above code creates too many “Integer” objects due to auto boxing.

Q2. How do you know that the above auto unboxing and boxing code were executed? A2. Because of “javap“. “SumNumbers” is the class file

Read more ›

Posted in Memory Management, Performance

Processing large files efficiently in Java – part 1

Q1. What are the key considerations in processing large files? A1. Before jumping into coding, get the requirements. #1. Processing a file involves reading from the disk, processing, and writing back to the disk. It is also a trade off in terms of what is more important to you like

Read more ›

Posted in IO, Memory Management, Performance
Tags:

10: ♦ 8 Java Maps & Caching Data in Java Interview Q&As

Q1. What is the purpose of a Map interface in Java collection API? A1. A map is a set of associations between pairs of objects. One is known as a “key” and the other is known as a “value”. It is used very frequently in programming in case where for…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training and 2-Year-Java-JEE-Career-Training

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in Collection and Data structures, member-paid, Memory Management, Performance

♦ Monitoring/Profiling Java applications interview Q&A

Q1 How will you go about monitoring your Java application for potential performance or memory issues? A1 1. Visual VM for monitoring Java memory, CPU, threads, etc VisualVM is a visual tool integrating several command-line JDK tools and lightweight profiling capabilities. Designed for both production and development time use, it…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training and 2-Year-Java-JEE-Career-Training

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in FAQs Java Key Areas, member-paid, Memory Management, Performance, QoS

8 Java memory management interview Q&A

Q1. Are memory leaks possible in Java, which has memory management via automatic Garbage Collection? A1. Memory and resource leaks are possible in any robust application. In managed languages such as Java and C#, the developers do not have to worry too much about memory management as the garbage collector…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training and 2-Year-Java-JEE-Career-Training

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in FAQs Java Key Areas, member-paid, Memory Management
Tags:

800+ Interview Q&As ♥Free|♦FAQ (Mouse Hover for Full Text)

open all | close all

200+ Java FAQs – Memory Joggers

open all | close all

16 Java Key Areas to be a top-notch

open all | close all

80+ Java Tutorials – Step by step

open all | close all

100+ Java Coding Exercises

open all | close all

How good are your "Career Skills"?

open all | close all