Recommended: Sing it, brah! 5 fabulous songs for developers
JW's Top 5
Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
The Java automatic garbage collection process typically operates as a low-priority thread that constantly searches memory for unreachable objects, objects not referenced by any other object reachable by a live thread. Different JVMs use different algorithms to determine how to collect garbage most efficiently.
In the JVM, memory is allocated in two regions:
new keyword are allocated. Since local variables are few in number, only primitive types and references, usually the stack will
not overflow, except in cases of unusually deep or infinite recursion. The JVM throws a Java out-of-memory error if it is
not able to get more memory in the heap to allocate more Java objects. The JVM cannot allocate more objects if the heap is
full of live objects and unable to expand further.
The four typical causes of memory leaks in a Java program are:
Some approaches to detecting memory leaks follow in the list below:
totalMemory() and freeMemory() methods in the Java runtime class, which shows how much total heap memory is being controlled by the JVM, along with how
much is not in use at a particular time. This mechanism can provide the heap's memory utilization. However, details of the
heap utilization indicating the objects in the heap are not shown.
In the subsequent sections, I analyze some causes of memory leaks in enterprise Java applications using a sample application and a memory profiling tool. I also suggest strategies for detecting and plugging such leaks in your own projects.
Archived Discussions (Read only)