All these days, I was under the assumption that *INLR closes the open files and releases storage used by a program. Until now when I read an IBM material that said, it does close open files and reinitializes variables but does not release the storage for system's further use (unless the activation group ends or the sub system is brought down or IPL is done). So, my question is:
If the storage doesn't get released and just keeps on getting used up throughout the day, wouldn't the system run into a memory shortage (this might be a stupid question but its just because am not really aware of AS400 system technicalities). The first thing that comes into my mind and frightens me is: "What if it behaves like WINDOWS (run 5/10 normal applications together and you get a system that doesn't respond, works real slow and gets onto your nerves)." I have always believed AS400 ain't this way and always hope it to remain so.
Or is it that AS400 has a different memory allocation mechanism that we will never run into memory shortage or memory leaks? Could someone please clarify this for me?

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

Processing your response...

Discuss This Question: 7 &nbspReplies

There was an error processing your information. Please try again later.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

It can run out of memory. It might even execute an IPL. But that rarely happens if ever. Shops that use the iSeries normally have a lot of memory. In my experience, if you set on the LR indicator in a program, the files are then closed by the system. The system memory used is not reclaimed unless the activation group ends. If the program ran in the default activation group, it will only be reclaimed when you log off. That way, if you run your program again, the system won't go looking for available memory anymore. It will only reinitialize (for reuse) what it used the last time you ran whatever program you ran.
However, the memory that was used and was not reclaimed can still be stolen by other programs. If the system is running out of memory and the files are closed for your program that has ended, other programs will use that working storage if these other programs can't find any more memory.
For service programs though, the files are not closed even if you set on the LR indicator. You have to close it using the CLOSE operation code.
In the shop where I work for, they always close the files in programs and service programs either by setting on the LR indicator or using the CLOSE op code. And everything runs in the default activation group. And they use the RCLRSC too. No wonder they have a lot of problems. See the article "The 7 Deadly Sins of ILE" by Susan Gantner.
Regards,
Allan

Let me paste something from the AS/400 Disk Storage Topics and Tools PDF from IBM:
To understand why an AS/400 system can run out of storage, it is necessary to be
familiar with some of the basic concepts of storage usage on the AS/400 system
relative to data types and how they are stored:
• Data on the AS/400 system is stored either on hard disk (DASD) or in real
memory.
• The AS/400 system uses a storage management architecture called Single
Level Storage (SLS). SLS treats all addressable memory (either hard disk
storage or real memory) as one addressable space. This allows great
flexibility for application programs and users, and also increases the effective
address space on the system.
• To survive across an IPL, data needs to be on DASD.
• There are two types of data from the point of view of storage on the AS/400
system: permanent and temporary.
– Permanent is data that survives across an IPL if it is on disk (for example,
database files).
– Temporary is data that does not survive across an IPL. An example is the
work space for a job that is terminated by an IPL. Temporary objects are
not expected to be re-used.
• DASD on the AS/400 system can be divided into groups called Auxiliary
Storage Pools (ASPs). There is always one ASP, known as the system ASP.
There can be up to 16 defined ASPs: 15 known as user ASPs and the one
system ASP.
• A user ASP has a finite amount of storage available to it, defined by the
amount of DASD configured in it. When the amount of data in the ASP
reaches 100% of the capacity available, new data directed to that ASP is
re-directed to the system ASP instead. This data is called Overflow data.
• The % system ASP used field in the top right corner of the WRKSYSSTS
screen (Figure 88) reflects the total of Permanent and Temporary storage
used in the system ASP. If this value reaches 100%, the system stops, as the
system ASP has nowhere to overflow.

How the 100% used mark is reached
DASD consumption problems due to a permanent storage issue include
situations such as:
• Too much data is restored to the system from tape or optical
• Too much data is received over a communication link
• The overflow of a user ASP continues unchecked
DASD consumption problems due to a temporary storage issue includes
situations such as when a large query continues to create more and more
temporary storage to accommodate work files.
When I was in training, our instructor remarked that you can never crash an AS/400. A lot of us voiced out our disagreement. "All computers can crash", we exclaimed. He replied saying "Go ahead and try it." That was a stupid remark. So we did.
We created a query/program that continuously created workfiles and data in those workfiles. The company I trained with had their own AS/400. Our class ended at 6pm and at about 1am the next day, their system powered down.
Of course, in the normal daily run of events, this would not happen. That is, if your company has a good DASD maintenance or management strategy.
Regards,
Allan

The short answer is
NO - You won't see a Power i / iSeries / i5 crash like windows.
It's a real computer, so before it allowed itself to be taken down by some rogue/ errant routine such as described above, there would be all kinds of warnings broadcast to the QSYSOPR message Q.

Hey Guys,
Thanks a lot for the info - I really appreciate it. I will just clarify one thing from the below statement - "The system memory used is not reclaimed unless the activation group ends. If the program ran in the default activation group, it will only be reclaimed when you log off. That way, if you run your program again, the system won’t go looking for available memory anymore. It will only reinitialize (for reuse) what it used the last time you ran whatever program you ran."
I guess the above statement implies - I run a program once and say it used up memory location x'000A' to x'0000E' (hypothetical values) for the run. Once the program ends, it reinitializes the value in this memory and then when the program is called again, it can use the same reinitialized memory instead of going and fetching another new chunk of memory.
Thanks guys once again.
Ananthan

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

Processing your reply...

Ask a Question

Free Guide: Managing storage for virtual environments

Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!

Share this item with your network:

To follow this tag...

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy