Page 1 of 1

virtual memory

PostPosted: Sat Apr 26, 2014 6:38 am
by bobguo
when abend happened, we referred to the dump and found that every program has its own EPA(entry point address), and as if all the programs ran within one 2G virtual memory. But many times, i was told every program ran in its own 2G virtual memory....
i thought if every program has its own 2G virtual memory, they maybe has the same addresses as each other. But i have not find it in the dump.
could you please explain it to me? thanks!

Re: virtual memory

PostPosted: Sat Apr 26, 2014 9:01 am
by steve-myers
Within one address space, which potentially has 2GB of addresses it can use, there may be (in fact always are) many programs. Some of the addresses are assigned to the nucleus, other addresses are assigned to the link pack area. There are often programs loaded in the Common Storage Area (CSA).

Your idea that every program has 2GB available to it is completely wrong.

AMODE 64 programs can, in fact, use more than 2 GB. I may be wrong about this, but I get the feeling that storage with virtual addresses > 4 GB is a single address range shared by all address spaces. Virtual addresses between 2 GB and 4 GB are not used.

Re: virtual memory

PostPosted: Tue Apr 29, 2014 5:19 am
by Pedro
Within one address space,... there may be (in fact always are) many programs.

For simplicity of understanding the concept, you can equate an "address space" to a TSO user, a batch job, or a started task. Each one will have its own address space.

As a TSO user, all of these programs you run have to share the same virtual storage. For example, you can split the screen and have multiple programs started, along with ISPF itself, and the TSO monitor program. I cannot count the number of times that a developer has come to me saying "there is a bug in Acme product, it abends', only to find out the program being developed is corrupting Acme's storage causing it to abend.

When you submit a batch job, the job runs in its own address space with its own virtual storage.

Re: virtual memory

PostPosted: Tue Apr 29, 2014 5:43 pm
by bobguo
can I understand it like this:
when one system which consists of many programs was running, maybe program1, program3 and program6 were located below the line, and the left were located above the line?

Re: virtual memory

PostPosted: Tue Apr 29, 2014 7:04 pm
by bobguo
bobguo wrote:can I understand it like this:
when one system which consists of many programs was running, maybe program1, program3 and program6 were located below the line, and the left were located above the line?


what i really want to say is that within one 2G virtual memory, maybe program1, program3 and program6 were located below the line, and the left were located above the line...

Re: virtual memory

PostPosted: Tue Apr 29, 2014 9:20 pm
by Pedro
were located below the line, and the <rest> were located above the line...

Actually, I have heard of two different terms (the line vs the bar):
Below the line: programs that need to be loaded using a 24 bit address.
Below the bar: programs that need to be loaded using a 31 bit address.
Above the bar: programs that are loaded using a 64 bit address.

The load modules (programs) self-identify their loading requirements through the use of the RMODE parameter during the link-edit process. The author of the program determines those settings. You can browse SYS1.LINKLIB and see a variety of combinations of RMODE and AMODE.

When you use any program, the system's loader will load them in the 2G virtual storage. And yes, some of them may be loaded below the line, others above the line, and still others will be loaded above the bar.