| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (10 out of 14)

Determining Region 1 and Region 2 Memory Requirements

To determine how much memory to preallocate to Regions 1 and 2, use the measurement techniques listed under Measuring G2 Memory Usage. If the memory usage in either region never stops growing, see Causes of Unbounded Memory Requirements and Correcting Unbounded Memory Requirements.

When your KB uses memory correctly, and your measurements have satisfactory accuracy and reliability, follow the guidelines in this section and the instructions in Specifying G2 Memory Allocation.

Excess Memory Preallocation

G2 uses no more memory than it needs to represent all the objects in a running KB, so preallocating more memory than a KB needs does not increase performance. Neither does it degrade performance, because virtual memory systems page out unused memory and never page it in again.

However, needless memory preallocation should be avoided because it wastes memory that other programs could use, and inflates the figures for G2 memory usage obtained with operating system commands. Such inflation can produce the impression that more RAM is needed, when the real problem is that the preallocation should be reduced.

Safety Factors

To be sure that unexpected events will never require more memory that any test run showed to be necessary, you should add a safety factor of at least 10% to the memory sizes that you obtain by measurement. If your KB has a history of unexpected increases of memory requirement, the safety factor should be even higher.

Allocating Less Than the Default

The allocation table that G2 prints when invoked shows the default size of each region. If your KB needs less memory in any region than G2 provides by default, you can preallocate less memory than the default. However, you cannot allocate a region less than the minimum memory size shown for the region in the allocation table. G2 increases any such specification to the minimum value.

| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (10 out of 14)

Copyright © 1997 Gensym Corporation, Inc.