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

Caching Data in Java and LRU strategy

Q. What is the purpose of using a cache? A. A cache is an area of local memory that holds a copy of frequently accessed data that is otherwise expensive to get or compute. Examples of such data include a result of a query to a database, a disk file…...

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 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 Java Key Area Essentials, 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 Java Key Area Essentials, member-paid, Memory Management
Tags:

600+ Java/JEE Interview Q&As

open all | close all

200+ FAQs for Quick Java Interview Prep

open all | close all

16 Technical Key Areas to standout

open all | close all

80+ step by step Tutorials conducive to self-taught projects

open all | close all

100+ pre-interview coding tests

open all | close all

How good are your …..?

open all | close all