[comp.sys.amiga.advocacy] memory on MAC vs AMIGA

NJ_GOKEMEIJE@FANDM.BITNET (06/23/91)

>>Does the amiga use Dynamic Memory Allocation?

>From:  IN%"dant@ryptyde.cts.com" 21-JUN-1991 23:50:43.04
>>"Yep. No program runs out of memory until all memory is gone.
>>(Or there is no memory available in a large enough block)"
>
>Hmm. That doesn't sound like Dynamic Memory Allocation to me. So
>a program's allocation space cannot be discontiguous?

Sorry, I guess I was a little unclear:
It can be discontiguous. But if I do a Malloc for say 2 KiloBytes,
those 2KB have to be contiguous.
If a program does a lot of mallocs, each of them small, all of these
do not have to be contiguous, but if it makes one big malloc, that has
to be contiguous.
Problem is (if you do not have a MMU) that programs that do not free
their memory, or forget a small piece of memory, eventually cause the
computers memory to get fragmented is small pieces. Big Malloc are then
no longer possible, although their is plenty of memory.

>>"Off course there are two different kinds of memory:
>>Chip Ram on the custom chips data bus, accessable by the custom chips
>>(slow memory, but needed for graphics and sounds of the custom chips)
>>fast Ram on the CPU bus, accessable by the CPU, and fast.
>>Fat Agnus(chip) arranges the traffic inbetween the busses.
>>The CPU only sees a difference in addres, and waitstates, nothing else."

>>Of course chip ram is also accessible by the CPU, but the reason it's
>>slower is because the custom chips are always accessing it, so it has
>>to wait for access to the bus. Of course, fast ram is simply off the
>>bus and accessible only by the CPU, which is why it's called fast ram.

>The original Agnus could only handle 1 meg of memory, right? That's what
>I hear. You have to get the Fat Agnus upgrade to go beyond that. How much
>memory can the Fat Agnus address?

The original FAT Agnus could handle 1 meg on the CHIP bus, but only .5 MEG for
the custom chips. (the other .5 is called C00000 memory because that is
where it is located, and is called FAST RAM because the Custom Chips cannot
acces it, but the CPU still had to go through AGNUS to get it)

The FATTER AGNUS (the new agnus, since '90) can handle up to 1 MEG for the
custom chips, giving the user 1 MEG of memory for graphics and sounds and
i/o buffers. Remember that on a A500 and A2000 and A1000, you can still put
8 MEGS on the CPU data bus (never changed)

In the A3000 agnus can handle up to 2 MEGS of CHIP RAM. (because it has a 32
bit data bus instead of 16 bit)
Remember that on a A3000 you can put 16 MEGS of FAST RAM on the motherboard.
(because everything is 32 bit instead of 16 bit data busses)

So: Old A500/A1000/A2000: MAX .5 CHIP, .5 slower FAST, 8 MEGS FAST
    newer A500/A2000      MAX 1 CHIP , obsolete,       8 MEGS FAST
    A3000                     2 CHIP , obsolete,       16 MEGS on motherboard
                                                       GIGS on cards
Also remember that the whole addresspace in the computer does not need to
be continuous as in a MAC

On a MACINTOSH, IN THE INFO window the user can specify the amount of
memory to be used for each application.
After the application is started, that block of memory is basically treated
as being all of the memory, as if there was only one process running.
The stack starts on top (but can be no larger than 32 K), the heap starts
on the bottom. If the stack runs to big, the computer crashes, if the
heap runs out of memory, the application is supposed to die gracefully.
Than you can quit, change the size in info and restart.
If you turn Multifinder off, the application gets all of the memory.
I do not know what system 7 can do in addition to this, but still
memory gets allocated in a continous block for each process.

The MAC has a memory manager that runs in the background when the frontmost
application allows it to do so. this Manager will rearrange the HANDLEs
to block of memory in your application's memory, to prevent fragmentation.
This fragmentation is only in your apllications memory, not outside of it.
Handles are kept in the stack, which is still limited to 32 K

Defragmentation of the total memory is not prevented:
Suppose you start Superpaint: 700 K
than a small program (tetrs): 100 K
than you quit superpaint
and you try to restart it because you need more memory:
say: Superpaint              1200 K
Now that will not use the initial 700 K, but just add on top:
So it will look as follow:
System on the bottom: say 700 K (minimum for system 7 I believe, I saw 1700 K)
then nothing              700 K
tetris                    100 K
Superpaint               1200 K

Hope it helped a little bit, Nils Gokemeijer (NJ_GOKEMEIJE@FANDM)

dant@ryptyde.UUCP (Daniel Tracy) (06/24/91)

Responding to the following:

"Also remember that the whole addresspace in the computer does not need to
be continuous as in a MAC"

The System Heap is dynamically allocated and can be discontiguous.