java.lang.OutOfMemoryError – Types and Causes

The 8 symptoms that surface them The many thousands of java.lang.OutOfMemoryErrors that I’ve met during my career all bear one of the below eight symptoms. This post from haritibcoblog explains what causes a particular error to be thrown, offers code examples that can cause such errors, and gives you solution guidelines for a fix. The content is all based on my own experience. java.lang.OutOfMemoryError:Java heap space java.lang.OutOfMemoryError:GC overhead limit exceeded java.lang.OutOfMemoryError:Permgen space java.lang.OutOfMemoryError:Metaspace java.lang.OutOfMemoryError:Unable to create new native thread java.lang.OutOfMemoryError:Out of swap space? java.lang.OutOfMemoryError:Requested array size exceeds VM limit Out of memory:Kill process or sacrifice child java.lang.OutOfMemoryError:Java heap space Java applications are only allowed to use a limited amount of memory. This limit is specified during application startup. To make things more complex, Java memory is separated into two different regions. These regions are called Heap space and Permgen (for Permanent Generation): The size of those regions is set during the Java Virtual Machine (JVM) launch and can be customized by

read more java.lang.OutOfMemoryError – Types and Causes

Java Performance Tuning – Introduction

Java Performance Tuning Garbage Collection The Java programming language is an object oriented and includes automatic garbage collection. Garbage collection is the process of reclaiming memory taken up by unreferenced objects. The following sections will try to resume some of the concepts from this document and their impact on Application Server performance. Memory Management, Java and Impact on Application Servers The task of memory management that was always challenging with compiled object‐oriented languages such as C++. On the other hand, Java is an interpretive language that takes this memory management out of the hands of developers and gives it directly to the virtual machine where the code will be run. This means that for best performance and stability, it is critical that the Java parameters for the virtual machine be understood and managed by the Application Server deployment team. This section will describe the various parts of the Java heap and then list some useful parameters and tuning tips for ensuring  correct  runtime  stability  and  performance  of  Application Servers. Java Virtual Machines The Java specification as to what is “standard” for a given release is written and maintained by the Java Soft division of Sun Microsystems. This specification is then delivered to other JVM providers (IBM, HP, etc). JavaSoft provides the standard implementation on Windows, Solaris, and LINUX. Other platforms are required to deliver the code functionality but their JVM options can be different. Java  options that are preceded with “‐X” or “‐XX” are typically platform‐specific. That being said, many options are used on all platforms. One must read in detail the README notes from the various releases on various platforms to be kept up‐to‐date with the variations. This guide will mention the most critical ones and distinguish between those which are implemented on most platforms and those which are platform‐specific.   ——- Stay Tuned for More Java Performance Monitoring Posts ——-