Some of the issues previously reported with HSQLDB (v 1.71) were resolved in 1.7.2/1.7.3 releases. For 1.8.0 we have looked at all the persistence issues and introduced measures to prevent them.
For best performance and reliability, we need to draw up a list of startup parameters for HSQLDB and introduce them to the JBoss configuration files.
The latest 1.8.0 RC7 is available at http://hsqldb.sf.net (Note this is a Release Candidate and should be used only for testing)
Would JBoss developers please comment on the issues below:
1. HSQLDB stores the commands that modify data or database structures in the .log file. The only purpose of this file is to replay the commands from the last known state (CHECKPOINT) in case of abnormal termination. By default, when the .log file reaches 200MB a CHECKPOINT will occur and clear the .log file.
2. A CHECKPOINT will not reduce the size of the .data file. It will back it up to disk, which will take a few seconds. So it is a good idea to prevent the size of the .data file from growing too large. The .data file contains the persisted data plus some free space left over from deleted rows.
3. HSQLDB 1.8.0 keeps track of up to 500 recently deleted rows and uses the empty space in the .data file for new rows fairly efficiently. This means little empty space will be left unless suddently more than a few hundered messages are cleared, but no new ones are queued.
4. The CHECKPOINT DEFRAG command is available to reduce the size of the .data file by clearing the empty spaces. 1.8.0 introduces a database setting for the maximum allowed empty space. If empty spaces exceed this threshold, a DEFRAG is also performed with a normal CHECKPOINT.
5. The amount of memory used by HSQLDB can be reduced by setting the cache_scale property to a smaller value. The current defaults allow up to 50MB of binary data to stay in memory. Reducing the cache_scale to 12 will take this down to 12.5 MB (these values will be inflated by a factor of about 3 when measuring memory object usage in bytes).
REQUEST FOR COMMENT
1. By default, how much memory should be allocated to HSQLDB use (as a maximum)?
2. After how many messages should a CHECKPOINT occur? Each message translates to a few KB of logged information, so this can be translated into the maximum allowed .log file size.
3. How often should a DEFRAG occur at the time of checkpoint? This can be set with the maximum allowed empty space size.
Maintainer, HSQLDB Project