Short: A command to decrease the available RAM Author: Alex Carmona Uploader: Alex Carmona Type: util/cli Version: 1.3 Replaces: util/cli/AllocMem.lha Architecture: ppc-amigaos >= 4.0.5 DESCRIPTION AllocMem is a Shell command which temporarily allocates memory. Its main purpose is to artificially decrease the amount of RAM available without having to copy a large file to the RAM Disk. USAGE AllocMem [ or ] (defaults to bytes) Example: 'AllocMem 128 M SHARED' It will allocate 128 megabytes of "public" RAM and wait for Ctrl-C. Once it receives the Ctrl-C signal, it frees the memory and exits. By default the Size value is measured in bytes, unless either the KB or MB switch is provided. If both switches are provided, the Size value will be converted to GigaBytes. The command checks if the amount of requested memory is available and will exit with a detailed error message if it can't be allocated. This can happen not only if the requested memory exceeds the available memory, but also if it would would leave less than a few hundred kilobytes free, as Exec won't allow it. It's safe to try though. Memory allocations can be shared (a.k.a. public) or private (swappable). By default the allocation is private, allowing swapping to disk of the memory pages allocated. The SHARED switch tells Exec that other programs need to have access to that address space and consequently it won't be paged out. Use that switch when you want the allocated memory to remain unavailable for good, perhaps to cause the pager to kick in sooner when launching other tasks. POSSIBLE APPLICATIONS ˇ Testing the behavior of programs under low memory conditions ˇ Testing disk-based virtual (swap) memory ˇ Simulating a ľA1 w/256MB RAM on an XE with 512MB+ ˇ Simulating a Classic Amiga w/128MB RAM on an A1 ˇ Wasting memory for no good reason ;-) I did my best to make sure that it won't cause any crash, however the OS may become unstable if you allocate most of the free memory, leaving less than a few megs available. I could have added some safeguards against that but it would prevent testing such a scenario so I deliberately chose to allow it. The original motivation behind writing that command was that some bug in the BrowserII copy function prevents it from working unless the amount of free RAM is below 256MB, and I wanted an alternative to copying 100MB+ of data to RAM: to make it work. Since then, Stephan Rupprecht wrote "AvailMemPatch" which took care of that problem for all 68K apps. Thanks Stephan! LICENSE AllocMem is freeware. HISTORY 1.3 - Added SHARED switch to control the type of allocation 1.2 - Added more detailed shell output - Fixed a bug where it didn't check that AllocVecTags() actually succeeded but still acted as if it had allocated the memory 1.1 (internal) - Switched to AllocVecTags() 1.0 - First public release http://metacomco.com -- Amiga... Duh!