title: Performance issues using H2 DB in embedded mode with heavy load of data in database
body: <p>I am working a java application using H2 Database in embedded mode.
  My Application consumes 150mb of heap memory.</p>
  
  <p>Problem:
  Steps
  When I load H2 database with 2 mb of data, database access is fast and heap memory size 160mb.</p>
  
  <p>But When I load H2 database with 30 mb of data(h2 db file size =30 mb). Then accessing the database from my application is very slow. the reason being my application heap size is hugely grown to 300mb of size hence degraded performance. I confirmed using JConsole.</p>
  
  <p>So my understanding is since H2 database is developed using java and since I am using H2 database in embedded mode, the heap size of H2 Database is added to my application which is breaking the application.</p>
  
  <p>The problem is as H2 database size is grown, the performance of my application is degraded.</p>
  
  <p>How to resolve the issue?</p>
  
  <p>I have given the connection as</p>
  
  <pre><code> rurl = "jdbc:h2:file:/" + getDBPath() + dbname + ";CACHE_SIZE=" + (1024 * 1024) + ";PAGE_SIZE=512";
  </code></pre>
  
  <p>to increase the cache of H2.</p>