Performance bottlenecks – key challenges and solutions
A bottleneck can be any factor that prevents the system from meeting the performance target; it is a resistance to the flow of data. Bottleneck can be within any layer of the technology stack or the infrastructure. The bottlenecks in application layers can pertain to objects/methods. The bottlenecks at database level can pertain to queries and locks. The hardware bottlenecks relate to processor, IO layer, memory, and network layer.
Two major performance problems in Java applications include excess creation of objects or excess collection of garbage.
Objects need to be created before they can be used and garbage should be collected when they are finished with.
The more objects you use, the more garbage-cycling happens, the CPU cycle wasted
Each object creation is roughly as expensive as a malloc in C, or a new in C++, and there is no easy way of creating many objects together, so you cannot take advantage of efficiencies you get...