&gt; <i>&quot;avoid allocating objects on the heap&quot;</i><p>Sometimes I see this as a side effect of all of the available libraries for java.  Abstraction gets to the point where it&#x27;s not easy to predict the behavior of something you&#x27;re using.<p>Like, you&#x27;re using Tomcat, with CXF client libs, which...under the covers, uses HttpURLConnection.  Your app works great with http, but you need to switch to https.  Unknown to you, when you switch to https...your object count doubles.  Because the design decision all the way down at the bottom was to spin up a new object (per connection) to handle an SSL handshake.