Memory issues can be hard to diagnose. A useful graph we provide comes from our Collector JVM Garbage Collection metric, which shows how much garbage collection is taking place.
Garbage collection is the process of looking at heap memory, identifying which objects are in use and which are not, and deleting the unused objects. An in use object, or a referenced object, means that some part of your program still maintains as a pointer to that object. An unused object, or unreferenced object, is no longer referenced by any part of your program. So the memory used by an unreferenced object can be reclaimed, freeing up memory.
In Java, the process of deallocating memory is handled automatically by the garbage collector. The basic process can be described as follows:
The first step in the process is called marking. This is where the garbage collector identifies which pieces of memory are in use and which are not.
Referenced objects are shown in blue. Unreferenced objects are shown in gold. All objects are scanned in the marking phase to make this determination. This can be a very time consuming process if all objects in a system must be scanned.
Normal deletion removes unreferenced objects, leaving referenced objects and pointers to free space.
The memory allocator holds references to blocks of free space where new object can be allocated.
In LogicMonitor, extensive garbage collection times may indicate an issue with memory; ideally this should be as low as possible.
Michael Tarbet (Global VP of Sales, MSP) and Steve Kahn (Area VP, Channel Sales, North America) would LogicMonitor would like to exclusively invite you to watch the Arizona Diamondbacks vs Los Angeles Dodgers from a premium suite at Chase Field in Phoenix May 26.
Join LogicMonitor for drinks and industry insights as we discuss the observability problems modern enterprises are facing.
Join LogicMonitor for a CiscoLive Dinner @ SushiSamba - June 14th, 2022