Because smaller data queues have better performance than large ones, it's important to manage the size of the storage allocated to a data queue.
Each entry receives a storage allocation when sent to a data queue. The storage allocated will be the value that is specified for the maximum entry length of the data queue that was specified on the Create Data Queue (CRTDTAQ) command. When receiving an entry from a data queue, the data queue removes the entry, but it does not free the auxiliary storage. The system uses the auxiliary storage again when sending a new entry to the data queue. The queue grows larger when not receiving entries that are sent to the queue. Smaller queues that have not been extended past the initial number of entries have better performance. If a data queue has grown too large, delete the data queue by using the Delete Data Queue (DLTDTAQ) command. On completion of the data queue deletion, recreate the queue by using the Create Data Queue (CRTDTAQ) command.
There is another way to manage the size of a data queue on Release V4R5M0 and beyond. This consists of using the SIZE and AUTORCL keywords on the Create Data Queue (CRTDTAQ) command. You can use the SIZE keyword to specify the maximum number of entries and the initial number of entries for the data queue. You can use the AUTORCL keyword for a queue that has been extended to indicate if the data queue should have storage automatically reclaimed when the queue is empty. The amount of storage that remains allocated to the queue equals the initial number of entries specified for the queue when it was created. If AUTORCL contains a value of *NO, which is the default, the system does not automatically reclaim storage from unused space. To reclaim the storage the data queue uses, you would need to delete and recreate it as described in the preceding paragraph. Auto reclaim may be expensive depending on the size of the queue, so the initial number of entries specified on the Create Data Queue (CRTDTAQ) command should be set to the largest typical number of entries that are expected to be on the data queue. If the initial number of entries is set too small, the system will execute the reclaim function more frequently.