Re: Occurs Depending Memory Use
- From: "Chuck Stevens" <charles.stevens@xxxxxxxxxx>
- Date: Mon, 23 May 2005 12:14:27 -0700
Note that proposals to include the ability to declare "true"
dynamic-capacity tables as well as elementary items whose size can be varied
at execution time have been approved for inclusion in the working draft for
the COBOL standard that is planned for publication in 2008.
-Chuck Stevens
"Richard" <riplin@xxxxxxxxxxxx> wrote in message
news:1116875010.516177.103750@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>
> 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.
>
.
- References:
- Occurs Depending Memory Use
- From: Kevin Solomon
- Re: Occurs Depending Memory Use
- From: Richard
- Occurs Depending Memory Use
- Prev by Date: Re: Occurs Depending Memory Use
- Next by Date: Re: Of mice and men
- Previous by thread: Re: Occurs Depending Memory Use
- Next by thread: Re: Occurs Depending Memory Use
- Index(es):
Relevant Pages
|