Memory
Usage
Memory consumption is a constant issue in server environments. The Java language itself is one of the major reasons for memory problems because it fosters the creation of many temporary objects on the heap. There is also a certain overhead due to the general usage of Unicode and automatic memory management (garbage collection).
An application uses the memory resource as follows:
· Memory footprint
The amount of memory an application requires during the entire lifecycle in order to keep its state (data).
· Temporary memory demand
The amount of memory an application requires to perform a specific operation that is released afterwards. This memory is used for temporary data.
· Garbage throughput
The garbage throughput is the temporary memory demand for a unit that is allocated and released shortly thereafter, measured in time units. This memory consumption comes from calculations, like a StringBuffer or a Calendar. There is a direct connection between the garbage throughput and the temporary memory demand.
How an application uses memory depends on several factors. For the memory footprint it is important, how much data is kept in memory and how much data is stored in a database or files.
The temporary memory demand is highly dependent on the used algorithm to perform a certain operation. Sometimes execution can be accelerated by loading all or a big portion of the data to be processed into memory, do the processing and store the results in a database or file. For an isolated view, this is the fastest and easiest approach in the majority of cases. For the server the approach may be completely different. Because of insufficient memory resources, competing applications are slowed down significantly. Other applications have to work "on the disk” because caches are flushed too early.