A Java application can extend the amount of memory for use by a database by calling the Database method
extend()
.The following code snippet demonstrates the recommended way for Java applications to extend a database:
void extend_db_memory(Database db) { int size = 1024 * 1024; Database.Device[] dev = new Database.Device[1]; dev[0] = new Database.PrivateMemoryDevice(Database.Device.Kind.Data, size); db.extend(dev); }There is also a version of the
extend()
method that allows passing a connection context. For example, the above function could be rewritten as follows:void extend_db_memory(Database db, byte[] ctx) { int size = 1024 * 1024; Database.Device[] dev = new Database.Device[1]; devs[0] = new Database.PrivateMemoryDevice(Database.Device.Kind.Data, size); db.extend(dev, ctx); }