title: Spring boot high memory usage after some time
body: <p>I have a spring boot app deployed on digital ocean, my current droplet (virtual pc, named as droplet) has 1gb of memory.</p>
  
  <p>My app has some cron jobs that get infos from some APIs and stores on the db, i will explain it:</p>
  
  <pre><code>@Scheduled(cron = "50 0 0/12 * * ?")
  </code></pre>
  
  <p>^ this one clean some values from a table</p>
  
  <pre><code>@Scheduled(cron = "50 0 0/1 * * ?")
  </code></pre>
  
  <p>^ Same as above but for another table</p>
  
  <pre><code>@Scheduled(cron = "0 0/1 * * * ?")
  </code></pre>
  
  <p>^ Have two of this, that  get infos from a API, do some math accounts and then store the results on db.</p>
  
  <p>What i see from the monitoring tools is that my memory usage never goes down it always goes up a litle bit.</p>
  
  <p>It start with 40% of usage about 5 hours ago and now its at 75%.</p>
  
  <p>Theres something that i can do to cleanup the memory usage? Maybe a garbage collection?</p>
  
  <p>Im using mysql, btw</p>
  
  <p>Thanks</p>
  
  <p>-- Edit</p>
  
  <p>I just run visualvm, and the results are the show:</p>
  
  <p>Profiler:
  <a href="https://i.stack.imgur.com/vfgN0.png" rel="noreferrer"><img src="https://i.stack.imgur.com/vfgN0.png" alt="Profiler"></a></p>
  
  <p>Monitor:
  <a href="https://i.stack.imgur.com/6accV.png" rel="noreferrer"><img src="https://i.stack.imgur.com/6accV.png" alt="Monitor"></a></p>
  
  <p>Seems like gc is actually running, so, whats wrong? maybe i need to set max heap at digital ocean?</p>