Troubleshooting OutOfMemoryError in Java
The OutOfMemoryError is a common issue in Java applications, occurring when the JVM cannot allocate enough memory to fulfill a request.
The OutOfMemoryError is a common issue in Java applications, occurring when the JVM cannot allocate enough memory to fulfill a request.
Learn about Java Runnable and Callable Interfaces with simple examples and some of the main usages and differences between both interfaces.
Learn what is a daemon thread in Java, how to create a daemon thread, and various methods present for daemon threads in the Thread class.
Java UnsupportedOperationException is an unchecked exception and occurs when a requested operation is not supported in a class.
Learn about Java ArrayDeque and its features with practical examples. Learn to use it as Stack and Queue, and the difference from LinkedList.
Java SynchronousQueue is a specific type of BlockingQueue with no internal capacity and is primarily used in exchanging data between two threads.
Learn InterruptedException and when it is thrown with examples. We will also see how we can handle this exception in our code.
Learn what a Semaphore and a Reentrant Lock are along with practical examples. We will also explore some of the main differences between the two and the use cases where we can use these while working in a multithreaded application. 1. What is a Semaphore? A Semaphore is a Thread …
Learn to convert a List to a Map in Java using Streams, Commons collections, and Guava including Multimap class for duplicate list items.
Learn to create a List from array using Arrays.asList(array) and new ArrayList(Arrays.asList(array). Learn their differences with examples.
Learn IllegalMonitorStateException, when it is thrown with examples. We will also see how we can prevent our code from raising this exception
Learn the need and methods to join two threads in Java with examples. Learn to set wait expiration time and avoid thread deadlock conditions.
Collections.synchronizedMap() provides serial access to the backing Map, and ConcurrentHashMap is a thread-safe alternative to HashMap.
Learn the different ways of creating and starting new threads using Thread class, Runnable interface, ExecutorService and virtual threads.
Learn to create and work with the Java EnumMap in detail, difference between EnumMap and HashMap and the practical usecases for the same.
A nested Map is Map inside another Map. Learn to create a nested HashMap and add, remove and iterate over the elements with examples.
In this post, we are going to discuss thread priorities in detail and the different types of thread priorities in Java, and how a thread scheduler executes various threads based on their priorities. We will also see how we can set thread priority of a thread and how we can …
Learn the differences between TreeMap and HashMap in Java as both implements the Map interface but differ in functionality and performance.
IdentityHashMap implements the Map interface and has almost the same features as HashMap. It uses reference equality on key search operations.
Learn about the Java WeakHashMap, strong & weak references with examples. Also, learn the differences between WeakHashMap and HashMap.
HowToDoInJava provides tutorials and how-to guides on Java and related technologies.
It also shares the best practices, algorithms & solutions and frequently asked interview questions.