title: Why is an empty H2 database 2 MB in size?
body: <p>I'm building an application that uses an embedded H2 database. I used the tutorial to test it out and everything seemed to work fine:</p>
  
  <pre><code>import java.sql.*;
  public class Test {
      public static void main(String[] a)
              throws Exception {
          Class.forName("org.h2.Driver");
          Connection conn = DriverManager.
              getConnection("jdbc:h2:~/test", "sa", "");
          // add application code here
          conn.close();
      }
  }
  </code></pre>
  
  <p>I am curious however, in my home directory I now have a "test.h2" file along with a "test.lock" file. Why does an empty database end up being 2 MB? It seems kind of large, I would expect something in KB at most, given that all that is in it would be some default empty memory and some instructions for storing data in it. Is 2 MB the default memory allocated?</p>