Browse Prior Art Database

Maximize the Memory Usage When Using Apl2

IP.com Disclosure Number: IPCOM000099456D
Original Publication Date: 1990-Jan-01
Included in the Prior Art Database: 2005-Mar-14
Document File: 2 page(s) / 69K

Publishing Venue

IBM

Related People

Jensen, JR: AUTHOR

Abstract

This article describes a way to optimize the use of scarce memory when using the APL2 programming language. It requires very little change in program logic to work and, as such, is easy to implement. It is especially useful if the memory requirements during different stages of an application is not fully understood, or they vary randomly.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 52% of the total text.

Maximize the Memory Usage When Using Apl2

       This article describes a way to optimize the use of scarce
memory when using the APL2 programming language.  It requires very
little change in program logic to work and, as such, is easy to
implement.  It is especially useful if the memory requirements during
different stages of an application is not fully understood, or they
vary randomly.

      APL allocates memory automatically.  Most of the time this is
highly beneficial to the user, as it relieves him of the burden of
doing this. However, it can cause less efficient use of available
resources in memory-constrained situations, since the design has to
cater to the worst-case scenario, even if this may only be
encountered very infrequently.  A corollary of this is that the
available memory is not always utilized to its fullest potential.

      A simple way of overcoming this problem is to use the
trial-and-error principle.  The program will initially allocate
memory as though the data it will use is as small or minimal as
possible.  If this is not successful, it must backtrack and restart,
readjusting its use of memory to cater to a larger amount of data to
process.  This readjustment can take many different forms, but common
to them all must be that they all require less storage to run. A
simple example would be to cut the number of data records processed
at any time by, say, 50%. Depending on the initial start condition
and the "amount" of the adjustment, the program may have to be
restarted several times. Eventually, it will settle down to a state
where it will be processing just as many records as will fit in the
memory available.

      APL2 provides a built-in function to do the er...