We keep hearing that claim every time we discuss memory allocation. I tested with Chris's program. SInce my X1000 has 2GB memory I don't have a SWAP partion and Chris's program runs to completion. After the program runs for about 5 seconds my available memory as displayed by WorkBench drops from 1.8GB to 470MB. While the program was running and WorkBench showed 470MB, I tried to copy a 500MB file to ram: and it failed. When I tried the copy with Dopus4, it failed and reported DOS error code 0. When I used the copy command, only 9MB of the 500MB file was copied and the Copy command just returned as though nothing was wrong.tonyw wrote:Why do you think there is a problem?
There is no reliable way of measuring or reporting the amount of available memory. To put it very simply, Avail only lists the memory that has never been used or has been used, freed and cleaned, ready for reuse. It does not count the memory that has been used and freed, but not yet cleaned and made ready for reuse. The Exec does not waste time cleaning and returning freed memory to the heap (where Avail can see it), until it needs to.
There is only a problem if you can't load something that you should be able to load. For instance, if you could load TimberWolf before your test, but not load it afterwards, then there could be a problem. Don't take the output of Avail as gospel. Most likely all the "missing" memory will reappear as soon as there is a need for it.
My test indicates that in this case the claim that the memory will reappear when needed is wrong. Why is it that the response to reporting problems (with code proof) is frequently the same as the 5 stages of grief (the first step being denial). If people would actually try some testing with the provided code, it would be obvious if something is wrong (or not).
I think this test reveals a bug in the AmigaDOS copy command. If there is not enough memory or disk space available for a complete copy, an error should be returned; not an incomplete copy with no indication that anything went wrong. Regardless of the memory issues, that bug needs to be added to the list of things needing fixed.
EDIT: I tried your test after Chris's test program was running and the memory displayed in WorkBench dropped to 470MB. Timberwolf crashes when I try to start it. If I try to start OWB instead, it opens an empty window and stops. After OWB stops, all programs that require memory stop operating until Chris's program exits and returns all the memory to the system.