| Re: .0
Sorry, the Exec already does memory defragmentation when memory is
deallocated. The cause of fragmentation is small bits of memory that
really are allocated and prevent regions from coalescing.
(Well, there is one type of unnecessary memory fragmentation. The
autoconfig code will not coalesce memory from two separate memory
boards even if the memory does really form a big contiguous chuck
of your address space. So if you have separate memory boards, or
you have a 8 Meg board with 6 Meg installed, you could experience
this type of fragmentation. ASDG wrote a public domain utility to
remedy fragmentation due to autoconfig.)
About the only thing you can do is make a boot floppy with your
application on it, and try to get into your program as soon as
possible. Don't use any ram disks. Don't do any assigns. Don't
load the Workbench. Don't run any screen blankers or "pop up"
programs. Don't (or try not to) do anything that uses memory before
running your program.
|
| Re: .2
I think you've answered a different question, Christian. The problem is
that all the other programs in the system have fragmented memory,
and so there isn't memory enough for the user written application
to start.
The author of .0 was looking for something to do to the other
programs in the system to keep them from leaving memory fragmented.
> What it basically boils down to is to have your program allocate
> a sufficiently large chunk of memory and do all the tiny allocs
> with a custum alloc function from this pool.
I think the problem here is that the Exec will gladly carve memory up
into tiny chunks for tiny allocation requests. As long as those
chunks remain allocated, the system memory pool will look like
Swiss cheese. However, then those chucks are deallocated, the
Exec will coalesce them back together. The scheme you've described
allows an application that allocates lots of little chunks to
run at the same time as an application that needs a few very big
chunks.
> If you exit the application fragmentation will be minimal.
As I said before, if you deallocate the memory, it get coalesced.
The problem comes if you don't deallocate it, or somebody else
needs to run at the same time with you.
> There was a fine article about this topic by one of the Amiga engineers
> on UseNet quite a while ago. I'll check if I can locate it.
Please do. I would be interesting reading.
|