× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi, Simon:

You are correct -- I described an overly simplistic approach. (It was late in the evening.)

For cases where a long-running job needs to use dynamic storage, I have found that using "pools" of like storage is useful. The idea is to allocate all objects of a given "kind" (and lifetime) from the same "pool" -- this way, when you are done with that "kind" of thing, you just delete the entire pool. This simplified approach provides many of the benefits of "generational garbage collection" as seen in Lisp, Smalltalk, Java, etc., without all the overhead of true garbage collection.
It is fairly easy to do this using ILE heap support by creating a new ILE heap space for each unique "pool" (via the CRTHS MI instruction) then allocating from that specific heap, as needed (via the ALCHSS MI instruction). Then, when done with that "pool" of objects, issue the DESHS MI instruction for that particular heap.

Cheers,

Mark S. Waterbury

> Simon Coulter wrote:
Might be fine for a program that always runs in its own job, starts, does some work, and ends, but for anything that may run frequently in an interactive job or a long-running batch server type job this is just asking for trouble. Memory leaks abound in code with plenty of storage available and eventually they cause problems.

I'm fairly sure you know that but there are others who might consider this lazy way an acceptable one.

Pointers are like farm gates: if you open (allocate) it you should close (deallocate) it. If it's already open leave it open. With pointers however, there are some sloppy functions that return an allocated pointer and expect the caller to deallocate so it's more of a guideline than a rule but the point (hardeharhar) is obvious.

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.