Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!husc6!husc4!hadeishi From: hadeishi@husc4.UUCP Newsgroups: comp.sys.amiga Subject: Re: Help! I can't seem to run a program > 2meg in my 4meg Amiga Message-ID: <1126@husc6.UUCP> Date: Thu, 29-Jan-87 20:44:04 EST Article-I.D.: husc6.1126 Posted: Thu Jan 29 20:44:04 1987 Date-Received: Sat, 31-Jan-87 03:46:04 EST References: <12032@lanl.ARPA> Sender: news@husc6.UUCP Reply-To: hadeishi@husc4.UUCP (mitsuharu hadeishi) Organization: Harvard Science Center Lines: 89 Summary: Free list noncontiguity In <12032@lanl.ARPA> jtw@lanl.ARPA (James West) writes: >Could someone please explain why an AMIGA with a 4 megabyte memory expansion >will only run tasks that total to 2 megabytes or less??? > >Recently I added an AMERISTAR expansion bus with two 2 megabyte memory boards >and a hard disk. I am running the new Amiga 1.2 operating system with the >Absoft Fortran compiler. AmigaDos 1.2 auto configures memory, and >automatically sees the 4 megabytes. I can easily copy 4 megabytes of files >into the memory without any problems. It appears part of the operating system >sees the 4 megabytes, but part does not. To be exact, the part of the >operating system dictating memory available for running processes, appears >to be seeing only 2 megabytes! > >To try to understand what is happening, I wrote a simple 10 line fortran >program and tried some experiments. I dimensioned an array of 500,000 >and wrote into it, without any problem. This required 2 megabytes. >If I added another array of 50,000 words, this crashed the operating >system. Since 4 megabytes are available, I tried running two smaller >programs concurrently, each requiring 1.6 megabytes. Individually they >run fine, but together they crash the machine. > One possibility is that the free list has two blocks of 2 megabyte memory each. So even though you have 4 megabytes, it is partitioned into two blocks of 2 megabytes. If this is the case then you would be able to scatter-load a >2 Meg program (since the loader doesn't require the program modules to be contiguous in memory) but you wouldn't be able to create a continuous array >2 Meg. The fix for this would be somehow to tweak the free list at startup to merge to two blocks of memory together. However, it seems to me the memory boards should be set up to autoconfigure into contiguous regions. Note: are you using a 68020 board? Any 32-bit memory is automatically located way up there beyond the usual 16 Megabyte address space limit. If one of those memory boards is a 32-bit board, something is wrong. However, this would not explain why your machine crashed when you tried to run two 1.6 meg programs, nor why your machine crashed when you only ASKED for >2 Meg. AllocMem should simply fail if you have a fragmented address space and you ask for a contiguous area greater than 2 Meg. This is either a bug in 1.2 AllocMem (very possible, since AllocMem has been known to have had problems in earlier beta versions of 1.2) or a problem with the autoconfiguration of your memory board which leaves the free list corrupt. If you check the GURU when you crash, see if it is number 80000005 or 80000009; the first means free list corrupt, the second means an attempt to free a block twice has occurred (also due to a corrupt free list or possibly an errant program.) >Getting down to the Amiga operating system - AvailMem sees 4 megabytes of FAST >memory, but if I ask AllocMem to allocate any memory block greater than 2 >megabytes it crashes the machine. > >Granted this is not a reasonable action, but if I ask AmigaDos to set the stack >(with the STACK command) to any number greater than 2 megabytes, it refuses - >even when the machine is empty and 4 megabytes are present. > >I have spoken with the Absoft Fortran people, and they see no problem running >programs greater than 2 megabytes. I have spoken with the expansion bus vendor >and they do not understand why there should be a problem. My knowledge and >understanding of the Amiga hardware and software is limited, but my guess is >AmigaDos 1.2 has a BUG and is not allowing processes to use more than 2 >megabytes of memory - total. > >I called Amiga in Pa, and was told to call Marketing Link in Colorado. >Marketing Link, said the question was too technical, call the Amiga >engineers in Calif. The secretary for Amiga in Calif told me to >call Amiga in Pa for technical support! Where is the support??? You want to call developer support in West Chester. Hopefully someone there will see this plea and give a more knowledgeable response. NOTE: I seem to have had a problem with AllocMem() when allocating small bits of memory and then freeing them. After running my program a few times, the free list gets corrupted. When I got rid of one of the tiny allocations, the program stopped corrupting the free list, at least no guru after about ten trial runs. The allocation was a BitMap for a CUSTOMBITMAP Screen. According to the manual, I am supposed to be able to free the BitMap used in the NewScreen structure after it is used. Does Intuition do something weird and try to free the BitMap itself? This would make no sense whatsoever, and I have enough faith in RJ and Jim to believe that they wouldn't do such a thing. Of course, these problems could be due to the fact that I am using register variables in Lattice 3.10, which is notoriously nasty with registers. However my allocation deallocation routines don't use too many registers (more than 3) so I don't really know what the problem could be. -Mitsu