Re: Occurs Depending Memory Use
- From: "Richard" <riplin@xxxxxxxxxxxx>
- Date: 23 May 2005 12:03:30 -0700
Kevin Solomon wrote:
> Hi Everyone:
> If I define a second table with an OCCURS DEPENDING ON clause I had
be
> taught (and never before questioned) that memory allocation was
dynamic.
The overhead of reallocating the memory every time the 'depending on'
changed would be a complete waste. Typically a table may be built by
adding one item at a time and incrementing the depending on before
loading the data. This would mean that each increment would create a
new block of memory and then copy over the data to the new area and
release the old. Or how did you think dynamic memory worked ?
> The memory used would be only that which corresponds to the size of
one
> occurrence times the value of the depending on variable.
And what would be the point ? of actually reducing the memory, would
this allow some other program to use it ? If it did the table could
not grow back in the same place.
It acts _as_if_ it is the size specified by the depending on, but does
not allow other programs or other data areas to use the memory up to
the maximum specified.
> If there's no real savings in memory, then what's the point?
It acts _as_if_ the depending on is the actual size. If you write a
record it writes that size, not the whole area. SEARCH and SORT use
that size. If you MOVE the record, again only that size (saving CPU
cycles). BOUND chacks _may_ be done based on the depending on and not
the maximum size.
I would ask: what would be the point in reallocating a new memory area
and copying every time the depending on changes ? - because you would
have to to change the total memory usage.
.
- Follow-Ups:
- Re: Occurs Depending Memory Use
- From: Kevin Solomon
- Re: Occurs Depending Memory Use
- From: Chuck Stevens
- Re: Occurs Depending Memory Use
- References:
- Occurs Depending Memory Use
- From: Kevin Solomon
- Occurs Depending Memory Use
- Prev by Date: Re: Occurs Depending Memory Use
- Next by Date: Re: Occurs Depending Memory Use
- Previous by thread: Re: Occurs Depending Memory Use
- Next by thread: Re: Occurs Depending Memory Use
- Index(es):
Relevant Pages
|