Home / Companies / Rollbar / Blog / April 2021

April 2021 Summaries

2 posts from Rollbar

Filter
Month: Year:
Post Summaries Back to Blog
A java.lang.OutOfMemoryError: PermGen Space error occurs in Java when the PermGen area of the heap, which stores metadata such as class declarations and method bytecode, is exhausted due to an excessive number of classes or large classes being loaded. Java's memory is divided into various regions, including Young, Tenured, and PermGen, and the default sizes for these regions can be adjusted using JVM arguments like -XX:PermSize and -XX:MaxPermSize to prevent this error. An example of this error can occur when a loop loads a vast number of classes using a library like javassist, filling the PermGen space. Solutions include increasing the PermGen size and analyzing heap dumps to identify and minimize problematic objects. Additionally, tools like Rollbar offer automated Java error monitoring, helping developers manage and resolve such issues more effectively.
Apr 08, 2021 550 words in the original blog post.
A memory leak in Java occurs when an application unintentionally retains references to objects no longer needed, preventing the garbage collector from freeing up memory and potentially causing system performance degradation or an 'OutOfMemoryError'. Common causes include excessive session objects, unbounded caches, and improper use of static fields or unclosed resources. The improper implementation of methods like equals() and hashCode() can also lead to memory leaks, especially when working with collections like HashSet and HashMap. Detecting memory leaks involves using tools like memory profilers, enabling verbose garbage collection, and analyzing heap dumps. Effective management of Java errors can be achieved with tools like Rollbar, which automates error monitoring and triaging, thus easing the process of fixing errors.
Apr 01, 2021 1,070 words in the original blog post.