hi, > You can. But the point is, if you do want to use an explicit value, > then you need to set it each time you open the database. > ok, that's perfectly fine for me.
>> Why not let this value to be dynamically adjusted based on the >> available memory in the JVM conservatively ? >> Thus if, on the dbm could use idle memory. > That's what the automatic mechanism does. > I mean dynamically at runtime, but if I had understood that this value it's determined at database start and never adjusted, I'm right ? What's happen when at runtime we change the CACHE_SIZE to a greater or lower value , it's adjusted in the next database start or ... ? Is a costly operation to dbm change CACHE_SIZE at runtime or do nothing ? If you wonder why: I'm thinking in the case of H2 in embedded mode or started with a ConnectionPool as DataSource factory of Tomcat or another application server. In the same JVM we have the application (or Container) and the embedded H2 instance sharing jvm resources. To setup this scenario we need to estimate application or container memory needs (can be measured starting H2 as a server in a separated process) and then embed H2 with a convenient cache size. Because application/container memory needs must to taken in the worst peak plus a prudential margin, most of the time there will be available memory at jvm that H2 could use and release periodically. Ex. setup JVM -Xmx=512m Application/Container use = from 60m to 450m : avg 260m If we start H2 without specific cache size then they will be using 256m that can lead in a suboptimal situation. If we choice to set a fixed cache size to avoid that , then it must be set to some value bellow 200m, hurting h2 performance even if there are 400m of available memory in most of the time. In an application case we can get a thread adjusting cache size in regard of runtime.freeMemory() . Can be something like this possible ? regards Dario -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
