title: Java Out of memory Exception Occurring After Scheduling PostgreSQL Stored Procedure On Heroku Server
body: <p>My Java application is deployed on Heroku Server and it contains one scheduled job (which is Stored Procedure of PostgreSQL).</p>
  
  <p>The scheduler successfully starts the procedure execution and also logs get printed.</p>
  
  <p>But, after some time the java application causes an exception</p>
  
  <blockquote>
    <p>JAVA.LANG.OUTOFMEMORYERROR java heap space</p>
  </blockquote>
  
  <p>and it stops working without completion of the scheduled job.</p>
  
  <p>What should I do to resolve this error?</p>
  
  <p>Please Find Exception Screenshot</p>
  
  <p><img src="https://i.stack.imgur.com/7Cc1z.png" alt="Please Find Exception Screenshot"></p>