Hi, It depends a lot on the data. There is a value cache that caches commonly used values, so if values are used multiple times they are usually only stored once. But this cache is a lookup table, and it's size is limited, and there is no formula to calculate how much memory it will use in practise. It also depends on the JVM settings.
The only reliable way, and probably the easiest way, is to create a database, add reasonable data, and measure, using Runtime.freeMemory() / maxMemory() / totalMemory(). Before you measure, call System.gc() about 10 times, that will make it quite accurate. Regards, Thomas On Mon, May 6, 2013 at 7:43 PM, Jamie Wang <[email protected]> wrote: > Hi, > > I am wondering if there's a way to get database size, memory usage > statistics for an in-memory database either use API or utility tools are > all workable for us. So far the instance works well and we're going > through a phase to verify data growth rate and it's impact on memory size > increases. I believe there's compression used when store data in memory > only instance. Does anyone know the ratio? Or any procedures people have > developed and willing to share would be greatly appreciate it. Thanks in > advance for your time. > > Jamie > > -- > You received this message because you are subscribed to the Google Groups > "H2 Database" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/h2-database?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/h2-database?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
