Re: Occurs Depending Memory Use
- From: "Kevin Solomon" <kjsolo@xxxxxxxxxx>
- Date: Mon, 23 May 2005 19:48:16 -0400
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.
>
.
- Follow-Ups:
- Re: Occurs Depending Memory Use
- From: LX-i
- Re: Occurs Depending Memory Use
- From: Russell
- Re: Occurs Depending Memory Use
- From: HeyBub
- Re: Occurs Depending Memory Use
- From: Richard
- Re: Occurs Depending Memory Use
- From: docdwarf
- Re: Occurs Depending Memory Use
- References:
- Occurs Depending Memory Use
- From: Kevin Solomon
- Re: Occurs Depending Memory Use
- From: Richard
- Occurs Depending Memory Use
- Prev by Date: Re: IBM S/390 memory model and COBOL
- 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
|