title: How to measure and reduce your memory use in Jhipster app? when booting with Heroku
body: <p>I can not make my app to boot in Heroku (using hobby plan, Jhipster 5.7 ) because I'm using too much memory as Help Service says:</p>
  
  <pre><code>Your app is crashing because it is using too much memory when it boots:
  
  Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is java.lang.OutOfMemoryError: Java heap space
  
  You will need to use less than 512MB of RAM both at boot and at runtime. We do 
  have this page https://devcenter.heroku.com/articles/java-memory-issues that 
  provides some pointers for debugging memory issues.
  </code></pre>
  
  <p>So I've read the <a href="https://devcenter.heroku.com/articles/java-memory-issues" rel="nofollow noreferrer">https://devcenter.heroku.com/articles/java-memory-issues</a> document and I have several questions:</p>
  
  <p>1) Is there an easy solution for this problem? (if you are a programmer, not interesting in administration of your machine).</p>
  
  <p>2) Which program should I use to check how much memory I'm using: VisualVM?</p>
  
  <p>3) What thing should I look for in order to reduce memory usage and not create a bigger problem?</p>
  
  <p>Thanks</p>
  
  <p>EDIT FROM HEROKU CUSTOMER SERVICE:</p>
  
  <p>Java tends to be a little bit more memory hungry, but it should be obeying the JAVA_OPTS set. What happens when you just unset the JAVA_OPTS and rely on our defaults? You can unset it with heroku config:unset JAVA_OPTS -a jhipsterpress. I ask because typically we will automatically set JAVA_OPTS to something that should run correctly on the platform given available memory.</p>