# Managing Rows in Memory at Runtime

All view row spillover parameters are set on the business logic tier's Java VM.

#### To set Java VM parameters:

1. In the Workspace view of the Navigator, right-click a business component project and choose Properties.

2. In the Run/Debug pane, type the parameters in the Java VM Parameters field.

3. Click OK.

   The values are added to the jboserver.properties file, which is stored in \lib\jbomt.zip. When you deploy, you can include this file.

#### To enable view row spillover:

When you start the business logic tier's Java VM, include the following directive on the command line:

    -Djbo.use.pers.coll=true

The default is false, meaning view row spillover is not enabled.

#### To set the node number from the command line:

When you start the business logic tier's Java VM, include the following directive on the command line:

    -Djbo.pers.max.rows.per.node=n

Where n is a number 5 or greater. The default is 70, meaning that there can be a maximum of approximately 70 rows in a node at one time.

#### To set the maximum rows per node from the command line:

When you start the business logic tier's Java VM, include the following directive on the command line:

    -Djbo.pers.max.active.nodes=n

Where n is a number 2 or greater. The default is 10, meaning that there can be a maximum of approximately 10 active nodes per session. The business logic tier will try to keep up to 10 active nodes in memory. When more nodes are created, under normal conditions, least recently used nodes will be written to database first.

In addition, -1 is a valid value, meaning that spillover is disabled but you might still have nodes.

#### To set the node number in a view object definition:

To the XML file of a view object, add the following attribute:

    MaxRowsPerNode

Its value can be a number 5 or greater. The default is 70, meaning that there can be a maximum of approximately 70 rows in a node at one time. This setting overrides the command line setting for this view object.

#### To set the maximum rows per node in a view object definition:

To the XML file of a view object, add the following attribute:

    MaxActiveNodes

Its value can be a number 2 or greater. The default is 10, meaning that there can be a maximum of approximately 10 active nodes per session. The business logic tier will try to keep up to 10 active nodes in memory. When more nodes are created, under normal conditions, least recently used nodes will be written to database first.

In addition, -1 is a valid value, meaning that spillover is disabled (but you might still have nodes). This setting overrides the command line setting for this view object.

#### To clean up the view row spillover tables:

A database administrator must manually clear data in the database tables when it is no longer used. You can use the script \bin\bc4jcleanup.sql, which contains instructions for scheduling a cleanup routine to automatically clean up the database. Or you can use a procedure like the following:

1. In the PCOLL_CONTROL table, look at the value of the UPDATEDATE column of a row.

   Each row in the control table corresponds to a table for a transaction (the table name is prefixed with PCST_ ).

2. If the UPDATEDATE is over one day old, write down the value in the TABNAME column, then delete the row from PCOLL_CONTROL.

   If the UPDATEDATE is less than a day old, you should not delete it.

3. If the delete succeeds, you can drop the view spillover table that was listed in the TABNAME column.

   If the delete fails with a lock conflict, that means the table is in use. You should not drop the corresponding spillover table.

Related topics
About Managing Rows in Memory at Runtime