Hi, How much is the default persistent mode too slow for your use case?
> 1. We are building a high-performance, data-intensive solution. So we > need to use the in-memory mode, copying the data from another database > and keeping it in the same JVM as the code. Unfortunately, the copy > process itself will take a long time, so in addition to keep data in- > memory we need it to persist on disk, so if the system goes down we > won't need to copy it all from zero. Could there be a delay until the data is written to disk? If yes, you could persist the complete the complete database from time to time (using the command SCRIPT TO ...). If not, you could write some kind of log file (append only) so you could re-build the database if required. Another option is to use 'memory tables': http://www.h2database.com/html/grammar.html#create_table (CREATE MEMORY TABLE...). > 2. When we use the in-memory mode: > 2.1 Where do I set the max amount of memory it will use? In-memory mode will use as much heap space are required by the data. > 2.2 Is the memory shared with the other processes on the JVM, or H2 > "grabs" his part from the startup? It's shared. > 2.3 How can I know how much of the H2 memory is still free? Runtime.freeMemory() > 2.4 What happens when the assigned memory is full (discard data, > OutOfMemoryError, another...)? OutOfMemory. > 2.5 Can I set up a parameter in order to whenever the memory gets full > the rest of data go to disk? No, that's not supported currently. Regards, Thomas -- 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.
