Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!usc!rutgers!cbmvax!jjszucs From: jjszucs@cbmvax.commodore.com (John J. Szucs) Newsgroups: comp.sys.amiga Subject: Re: A few questions... Message-ID: <13250@cbmvax.commodore.com> Date: 17 Jul 90 15:10:55 GMT References: <51083@iuvax.cs.indiana.edu> Reply-To: jjszucs@cbmvax (John J. Szucs) Organization: Commodore, West Chester, PA Lines: 81 In article <51083@iuvax.cs.indiana.edu> amhartma@silver.ucs.indiana.edu (Andy Hartman - AmigaMan) writes: >I have a few questions: > 1) Is there a program which will un-fragment memory? > Defragmentation of memory by moving allocated blocks in memory (the memory equivalent of disk defragmentation) is not possible under the current Amiga memory management design because applications receive a direct pointer to the memory that they allocate. If that memory is moved, there is no way for the program to know that the pointer they received from Exec when they made the allocation is now invalid. However, Exec will automatically coalesce memory chunks as memory is freed by programs in the system. For example, if a block of memory is allocated as follows: +-----------+---------------------------+-----------+ | 1/2K Free | 1K Allocated by Program A | 1/2K Free | |-----------+---------------------------+-----------+ and program A frees the memory it allocated, the above will be coalesce into one 2K block of free memory. > 2) Why (on my 3 meg machine) do I get the following when I type > "avail" > > In-use Largest > ------ ------- > 129648 2041520 > >Where is the 3rd meg? (I interrupt WB immediately upon boot so nothing loads..) >(Note: I left out 2 fields of the actual output.) The full output from avail is probably similar to this (this is from my 5 meg A2500 with 1 meg of chip RAM running Kickstart/Workbench Release 2.0): Type Available In-Use Maximum Largest chip 715320 332232 1047552 714976 fast 3509536 684768 4194304 3506216 total 4224856 1017000 5241856 3506216 The Available column indicates the currently available number of bytes of chip RAM, fast RAM, and all RAM in the system. The In-Use column indicates the number of bytes of chip RAM, fast RAM, and all RAM currently allocated in the system. The Maximum column indicates the total number of bytes of chip RAM, fast RAM, and all RAM in the system (available or in-use). On a 3MB system, assuming 1MB of chip RAM, and 2MB of fast RAM, the Maximum column should read: Type ... Maximum chip 1047552 fast 2097152 total 3145908 Note that these figures may not exactly match the results on your system, but they should be fairly close. The Largest column indicates the size of the largest contiguous block of memory of chip RAM, fast RAM, or any RAM. For example, if on a 1MB system, the memory is allocated as follows: |--------------------------------1024K-------------------------------| +-----------+--------+--------------+--------+-------------+---------+ |400K system|32K free|135K Program A|96K free|90K Program B|271K free| +-----------+--------+--------------+--------+-------------+---------+ The Largest column would should 271K. >* Andy Hartman | I'd deny half of this crap anyway!| "Somedays, you just ================================================================================ || John J. Szucs || The opinions expressed are my own and || || Systems Evaluation Group || in no way represent the opinions or || || Product Assurance Department || policies of Commodore Technology, Inc. || || Commodore Technology, Inc. || or any associated entity. || ================================================================================ ...{rutgers|uunet|pyramid}!cbmvax!jjszucs jjszucs@cbmvax.commodore.com