Book Image

WildFly Performance Tuning

Book Image

WildFly Performance Tuning

Overview of this book

Table of Contents (17 chapters)
WildFly Performance Tuning
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Large objects


When designing and implementing an application, it is worth remembering to avoid allocating very large objects that are kept alive for a long time. The problems with these objects are that they have the potential to severely fragment the heap. Despite good GC strategies and improved defragmentation techniques, consequences can, in the end, be catastrophic for JVM, often in the shape of a java.lang.OutOfMemoryError error.

Large objects that have a short lifespan will be collected relatively fast and won't cause many problems. If these large objects are also allocated at the same time, they can be stored as continuous memory space, fragmentation can be kept to a minimum. They are also likely to be collected at the same time.

Another good solution is to chop the large objects up in to smaller ones, as this will make their long lifespan less cumbersome for the memory handling of JVM. Should none of these techniques be an option, the solution of enabling large memory pages might do...