Re: Occurs Depending Memory Use



Thanks to everyone for your replies.

If I understand what Richard's saying, the only real savings of using an
OCCURS DEPENDING ON clause is in overall performance and not in the amount
of memory allocated. Of course, this means that I do not have a solution to
the actual problem we were trying to solve with this construct.

The problem is simply that we have a program that for the next processing
year will require seven or eight tables of between 1 and 10,000 occurrences
and we're endevouring to find a way to use only the amount of memory that is
actually necessary for each iteration. As I stated in my original post, the
program executes online in CICS. (If the program was executing in batch,
we'd not have a need to optimize memory.) There is a potential for several
hundred concurrent users of the program. If one iteration of the program
requires 4MB-6MB of memory and there are several hundred concurrent users
and several thousands of other programs competing for resources, you can see
why we'd rather not take 4MB of memory for each instance of the program when
it is only the maximum that would be required.

The number of occurences that are required for each iteration is variable
upon a count of transactions returned from a DB call. Does anyone have any
ideas on how memory use might be optimized?

Thanks.

"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.
>


.



Relevant Pages

  • Re: Occurs Depending Memory Use
    ... IBM supports NON-Standard ODO's (Occurs Depending On) where they are either ... > question on memory allocation and memory use in employing an OCCURS ... > DEPENDING ON clause versus an OCCURS TIMES clause. ...
    (comp.lang.cobol)
  • Re: Occurs Depending Memory Use
    ... dynamic-capacity tables as well as elementary items whose size can be varied ... > The overhead of reallocating the memory every time the 'depending on' ... >> If there's no real savings in memory, ...
    (comp.lang.cobol)
  • Re: Occurs Depending Memory Use
    ... > If I understand what Richard's saying, the only real savings of using ... > an OCCURS DEPENDING ON clause is in overall performance and not in the ... > amount of memory that is actually necessary for each iteration. ...
    (comp.lang.cobol)
  • Re: [discuss] Re: 32-bit dma allocations on 64-bit platforms
    ... > Depending on the architecture (more precisely depending if it starts ... > allocating ram from the end or from the start of the physical memory), ... > through the swap device to relocate memory because memory would been allocated ...
    (Linux-Kernel)
  • Re: Connection lost.
    ... The interval is Minutes, depending on client activety ... If there is none for that amount of time. ...
    (microsoft.public.windows.terminal_services)