This article covers the basics: <a href="https:&#x2F;&#x2F;devcenter.heroku.com&#x2F;articles&#x2F;java-memory-issues" rel="nofollow">https:&#x2F;&#x2F;devcenter.heroku.com&#x2F;articles&#x2F;java-memory-issues</a>