Details
-
Improvement
-
Status: Closed
-
Trivial
-
Resolution: Implemented
-
3.1.x
-
All
Description
The current TempClassLoader potentially uses a new 8k ByteArrayOutputStream per class that it inspects.
Whilst hunting for a possible ClassLoader issue I found that replacing the ByteArrayOutputStream with a reusable one leads to a substantial reduction in memory during server start up.
I am unable to quantify what 'substantial' means in real terms as I have not run any real benchmarking, but it is fair to say that I had noticed heap sizes growing to over 180m during a server start compared to the 90m that I have now. These values would be application specific, but it would be nice to see if this is an improvement for others.
I have also synchronized a few access methods to ensure that resources are protected during the inspection process.