I have a customer that's getting an out-of-memory error on a realloc. The size requested is only about 800k so it's unusual. What limits the default heap memory available to an activation group?

On 7/30/2019 3:16 AM, Mark Waterbury wrote:
Not sure exactly what you may be after, or trying to control, etc. -- but a good place to start is to look at the MI instructions pertaining to the heap:
    ALCHS    Allocate Heap Space
    CRTHS    Create Heap Space    etc.

Start here:
https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_73/rzatk/topics.htm#topics__heapman

Each ILE activation group (including the default activation group, as a special case, for OPM programs), gets its own associated ILE heap space.   But, you can also use the CRTHS MI instruction (or the equivalent ILE built-in function) to do this yourself, thus creating additional heaps that you want to manage yourself.

Study the CRTHS instruction to see all of the various "attributes" of these heaps that you can control.

See also the ILE Concepts manual, here:
https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/ilec/sc415606.pdf

Chapter 10. Storage management.


Chapter 10 talks about the CEE APIs for Heap Space management.  Most of them are almost a one-to-one mapping on top of the above mentioned MI instructions.   So, from any ILE higher-level compiled language, you can use those APIs directly to manipulate the ILE heap(s).


By the way, if you ever code %ALLOC or the ALLOC opcode in ILE RPG IV, you are in fact using CEEGTST.

Page 123 of the above manual talks about various attributes for "tuning" and controlling the ILE heap spaces.

Also, for the best possible performance, never do a "dispose" -- just do new, new, new, or alloc, alloc, alloc, and then, destroy (delete) the entire heap space when you are done with "all that stuff."   There is a flag that gets set the first time you do a "dispose" or "free" of storage in each ILE heap, and once that flag is set on, every call to alloc, free, etc. for that heap space, incurs additional storage accounting "overhead".


Does that help?

Mark S. Waterbury

On Monday, July 29, 2019, 6:18:23 PM EDT, Tim Bronski <tim.bronski@xxxxxxxxx> wrote:
What are the all parameters that control an activation group's heap
space size?


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.