PMS Information Systems
Welcome to PMS Information Systems - IBM i (AS/400) Forum !!!

Get Answers for all your queries on IBM i (AS/400).

Activation Group in Detail

View previous topic View next topic Go down

Activation Group in Detail

Post  maran on Sat Aug 11, 2012 1:09 am

Activation Groups in Detail



Think activation group as a container for memory and other resources.
This container as per ile is also called as ‘’substructure of job’’.In other words a job owns its activation group; a job can have many activation groups. So an activation group is a resource container with in a job.

But the question arises what that container consists of?

Answer for that question is it holds bunch of activations so the term called activation groups.
In other words an activation group is reference to the storage allocations and runtime program binding activities that an operating system performs when a program executes.

Basically the concept of activation group comes in to picture when using modularity concept i.e ile are
Normally previous environments before ile uses default activation group.
If we write any program in rpg4, if u want to compile that program take prompt for 14 option u will see option for default activation group as (*yes)
If u compile u r program with the same option the program can’t use the ile features like procedures, service programs, binddirectries, this program will be considered as opm (original program model) even it is written in ile.
Normally if any program is written in ile you will see theH spec with option default activation group (*no), this allows the program to compile with all ile stuff.

There are 4 types of using this default activation group option depending upon the requirement

Actgrp (*new):

This means that every time the program is executed, it creates anew activation group, or container, for all the resources necessary to run the program. memory will be allocated the program will be copied in to the activation group, all the variables will be initialized and so on.

This is very similar to opm (original program model), when program reaches termination, activation group will be deleted and all the resources used will be reclaimed.
As all you guess this will be a big head ache to operating system, think if the program is executed 50 times a day, from the same job, you are creating an activation group, executing the program, destroying the activation group for 50 times, this adds a lot of over head to your job and it certainly effects the performance.

One thing to remember about *new is every call to the program, variable values, file status are new every time to the program.

Actgrp (*Caller)

The default option for crtsrvpgm (create service program) will be *caller. Any program or service program with option *caller will run inside the activation group of calling program. Or procedure. This can really improve performance in your application.
Because it removes the overhead of creating activation group. Using *caller will work fine for most procedures that are activated by other procedures. That is why it is used as a default option for service programs.

Actgrp (System Named - OILE)

Actgrp(User Named )

This has the best performance. a named activation group is one for which you specify name. The first time the program or service program executes, it goes through the over head of creating group, but then that group remains active until it is reclaimed or the job is ended. Now if any subsequent time the program is called it will run in the already existing group. Since the activation group is already running start up time can be reduced, as promised earlier it will improve performance.

I will tell you people one example how performance get decreased when u use default activation group (*new)
Let us take an example of a web page, every web request required the as400 server to create an activation group, answer the request and destroy the activation group. this is a lot of head ache for something as simple web page, several users may request the same web page thousand times an hour, imagine the situation how will be the performance so it all matters about the performance of your application.

Activation groups for service programs: Actgrp (*named)

The default activation group for the service program will be *caller, when u consider that most service programs consist of procedures that are called and used by other programs it makes perfect sense to let a service program run in the same activation group as the program that is calling the service program.

Suppose think of an situation like this if u are having 100 programs in 100 activation groups all these 100 programs using the same procedure in one service program1, there will be obuisoly 100 activations for that service program, that could effect the performance note it all matters about performance of your application

To overcome this situation you keep your service program in the named activation group.so that all the calling activations will share the activation of service program.

If u create your service program with named activation group , if program A calls this service program 50 times program B calls this service program 100 times then the total will be 150, since there is only one activation for your service program its behavior appears different the difference is in which activation you are aceesing.

This can be most powerful feature because it allows you to share values across multiple activation groups with in the same job, it could also get in trouble if you didn’t release this was going to happen when u create your service program with named activation group.


Useful points:

If u have an activation group that is not used and if u want to get rid of this you can use the command RCLACRGRP. Indicate ACTGRP (*eligible) to delete all non active but existing activation group, or indicate name of specified activation group to delete the specified activation group.

If u wants to see an activation group, you can’t really see an activation group but you can see the list of activation groups for a particular job. go to WRKJOB or WRKACTJOB and select option 5 for the job you want and select option 18 display activation group if active you will see all the activation groups for that particular job and a status indicator.
avatar
maran
Admin

Posts : 442
Join date : 2009-07-24

View user profile http://pmsinformationsystem.forumotion.net

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum