home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 27 / amigaformatcd27.iso / -coverdisks- / 111a / poolmem / poolmem.readme < prev    next >
Encoding:
Text File  |  1998-04-04  |  11.5 KB  |  306 lines

  1. Short:    Memory defragmentizer/AllocP superset
  2. Uploader: thor@math.tu-berlin.de (Thomas Richter)
  3. Author:   thor@math.tu-berlin.de (Thomas Richter)
  4. Type:     util/sys
  5. Version:  1.22
  6. Requires: OS 2.0 at least
  7.  
  8. ______________________________________________________________________________
  9.  
  10. Several people reported instabilities when running PoolMem. I can't reproduce
  11. any of these crashes here at my system, thus if you find a REPRODUCABLE crash,
  12. please, please let me know!
  13. ______________________________________________________________________________
  14.  
  15. NEWS FLASH: Found serious bug in XiPaint that caused crashes with PoolMem,
  16. check below for details.
  17. ______________________________________________________________________________
  18.  
  19. 1.22:
  20.  
  21. PoolMem merges now automatically all adjacent memory lists of the same type.
  22.  
  23. 1.21.1:
  24.  
  25. Included a new version of PatchRAM (check PatchRAM.readme for details),
  26. and a new version of the FragMeter program.
  27.  
  28. 1.21:
  29.  
  30. PoolMem flushes now the memory as it should if called by AllocMem(-1,..).
  31. Except that, nothing changed.
  32.  
  33. 1.20:
  34.  
  35. Added the CHIPFWD command. Works like INSTALL but allocates chip mem in
  36. standard (forwards) mode instead of backwards mode. Might solve strange
  37. compatibility problems. Added more sanity checks, included PatchReplyMsg
  38. to create warnings for broken programs.
  39.  
  40. 1.19.1:
  41.  
  42. Changed the name of the DefragMeter to FragMeter because that makes more
  43. sense. Added a chunk count to this program. PoolMem itself unchanged.
  44. ______________________________________________________________________________
  45.  
  46. About PoolMem:
  47.     
  48.     If you run a lot of programs without resetting the system, you'll
  49. usually find that the main memory of the computer is getting "messed up",
  50. split in lots of tiny memory "snippets" that are more or less useless due to
  51. their tinyness. It may happen that you can't start an application even though
  52. enough memory is available - because this memory is too fragmentated to
  53. be of any use.
  54.  
  55. That's the point where PoolMem tries to help you: It manages the main memory
  56. in a way such that it can't get fragmentated too easely. It replaces also
  57. the function of AllocP, which is therefore obsolete.
  58.  
  59. ______________________________________________________________________________
  60.  
  61. Installation and Usage:
  62.  
  63.     Copy the PoolMem program in this archive to the C: directory of your
  64. system partition. Add the following line to your startup-sequence:
  65.  
  66. PoolMem >NIL:
  67.  
  68.  
  69. You might also want to install "PatchRAM" which is included in this archive,
  70. too. It modifies the system RAM disk in a way that avoids memory 
  71. fragmentation, too. Another bonus is that the RAM disk will show its true
  72. size from now on, i.e. it won't be no longer 100% full.
  73.  
  74.  
  75. To remove PoolMem later on, open a shell window and enter
  76.  
  77. PoolMem remove
  78.  
  79.  
  80. Other command line options:
  81.  
  82. PoolMem install        Identical to the standard installation
  83.  
  84. PoolMem    ChipFwd        Doesn't allocate chip memory backwards. Might solve
  85.             compatibility problems, but isn't perfect for the
  86.             fragmentation.
  87. ______________________________________________________________________________
  88.  
  89. Compatibility:
  90.  
  91.     There are a couple of relatively deep patches of the memory system
  92. that shouldn't be run together with PoolMem:
  93.  
  94. - SetPatch:    The 68040 library which is loaded by this program seems
  95.         to allocate the MMU tables in a strange way incompatible
  96.         to the scratch list of PoolMem. Easy solution: run
  97.         PoolMem after SetPatch.
  98. - MemSniff:    (The THOR MungWall replacement)    Patches deep into the memory
  99.         allocation routines, too deep for PoolMem.
  100.  
  101. I guess that's all for now...
  102.  
  103.  
  104. Buggy programs that crash with PoolMem installed:
  105.  
  106. - XiPaint 3.2 (or XMouse, to be precise):
  107.  
  108. The message handling of the mouse driver is broken. After a long debug 
  109. session deep into the night, I found that the crashes were created by the
  110. mouse driver XMouse. It replies messages that are no longer valid and have
  111. been FreeMem()'d before. THIS IS DEFINITELY ILLEGAL AND NOT A POOLMEM PROBLEM.
  112.  
  113. To help you checking other programs as well, I included a tiny patch
  114. "PatchReplyMsg". You shouldn't install it permanently, though, because it
  115. slows down the message system. If, after installation of this patch, a 
  116. program crashes with guru 0x01000001f, THEN THIS PROGRAM HAS THE SAME BUG
  117. AS XIPAINT and replies illegal messages. This will crash your system anyways,
  118. with or without PoolMem. Please sent a bug report to the author, or remove
  119. these programs. As I said, THIS IS NO POOLMEM problem.
  120.  
  121.  
  122. The guru 0x01000013 is rather typical for these programs - they invalidate
  123. the internal scratch list of PoolMem.
  124.  
  125. ______________________________________________________________________________
  126.  
  127. Theory of operation:
  128.  
  129.     PoolMem splits all available memory in two blocks: One block is used 
  130. for the small memory snippets (always taken from there), the other block is used
  131. for huge allocations. This partition of the main memory is dynamic, i.e. each
  132. sub-pool can grow and shrink, depending on the memory requirements.
  133.  
  134. The "public/ANY" memory gets a special treatment. PoolMem manages a "scratch"
  135. list for tiny memory blocks taken from there. Instead of taking these tiny
  136. memory blocks always from the main memory, they are taken from this (global,
  137. though) memory pool and put back into this pool if they get freed. A special
  138. garbage collection task cleans this "scratch list" from time to time, or if
  139. it overruns. The main profit is taken from the layers.library, which uses to
  140. allocate tons of tiny snippets and is therefore the main cause for memory
  141. fragmentation.
  142.  
  143. The "chip" memory is treated a bit different. It's also split into two 
  144. distinct memory pools (small and large), but memory from the large pool
  145. is allocated in reverse direction - unless you run PoolMem with the
  146. ChipFwd keyword, of course; this happens for two reasons: First, it
  147. helps to keep the memory defragmentated, so the big pool can't run that
  148. easely into the small pool. Second, it works around a hardware bug of my
  149. computer (the refresh of the high end chip memory in my computer seems to
  150. be a bit buggy - some bits tend to flip if they aren't frequently accessed,
  151. for example by the DMA processor as display memory.)
  152.  
  153. For details about the PatchRAM program, check its readme file. As I said, if
  154. you run PoolMem, you're supposed to run PatchRAM as well. It helps PoolMem
  155. a lot in its job!
  156.  
  157. _________________________________________________________________________________
  158.  
  159. Additional programs:
  160.  
  161. The PoolMem program is still in a somewhat experimental stage, even though
  162. it's running stable for my system for more than two years now - I won't
  163. expect any serious bugs, though.
  164. However, if you like to see how PoolMem works and if it has any effects, I
  165. provided several extra programs:
  166.  
  167. ShowMem:        Shows the allocated/free memory in a graphical over-
  168.             view. For details, check the ShowMem readme and its
  169.             guide. (Available separately as well)
  170.  
  171. PatchRAM:        Modifies and improves the RAM disk. Shows the correct
  172.             size of the RAM drive, improves the memory allocation
  173.             sheme of it as well. Should be run together with
  174.             PoolMem. For details, check the guide of PatchRAM.
  175.  
  176. FragMeter:        Calculates the fragmentation of your memory. The
  177.             output is given separately for each memory type.
  178.             A 100% defragmentation indicates that all the free
  179.             memory is messed up in tiny blocks of eight bytes
  180.             each (maximal defragmentation).
  181.             A Shannon-type approach is used to measure the
  182.             defragmentation (the algorithm calculates the
  183.             Shannon entropy of the memory blocks with the formula
  184.             sum += log(chunk->mc_Bytes/total)
  185.             If you've a better approach for measuring the
  186.             fragmentation, lemme now. This here seems at least
  187.             reasonable for me as a theoretical physicst... ;-)
  188.             
  189.             This program can be used to test the efficency of
  190.             PoolMem. My measurements indicate that the entropy is
  191.             about halved.
  192.  
  193. MemoryMess:        A program that tries to fragmentate the main memory
  194.             as worse as possible by allocating and freeing memory
  195.             in random order. Can be used together with the 
  196.             FragMeter to measure the efficiency of PoolMem or
  197.             with ShowMem to watch PoolMem at its job. Can be
  198.             canceled safely with ^C (Control-C). Does nothing
  199.             useful except that.
  200.  
  201. PatchReplyMsg:        Useful to find buggy programs, like XiPaint.
  202.             PatchReplyMsg will create a guru 0x0100001f if a
  203.             program attempts to reply an already de-allocated
  204.             message. Don't install it permanently, but use it
  205.             to find the reason for crashes.
  206.  
  207.  
  208. If you've ideas how to improve PoolMem, lemme know....
  209.  
  210. ______________________________________________________________________________
  211.  
  212. Guru meditations thrown by PoolMem:
  213.  
  214. 0x01000013        Scratch entry illegal.
  215.  
  216.             Some program invalidated the internal memory scratch
  217.             list of PoolMem - by overwriting memory that has been
  218.             deallocated before. An (in)famous example is XiPaint.
  219.             Run "PatchReplyMsg" and a debugger (e.g. COP) to check
  220.             for details.
  221.  
  222. 0x0100000f        MemHeader not found.
  223.  
  224.             Some program attempted to free a non-existing block
  225.             of memory. PoolMem (or exec) wasn't able to locate
  226.             the MemHeader.
  227.  
  228.  
  229. 0x01000011        MemHeader insane.
  230.  
  231.             PoolMem found a MemHeader whose number of available
  232.             bytes does not match the size of its pool.
  233.  
  234.  
  235. 0x01000012        Invalid DeleteHeader (internal).
  236.  
  237.             Someone tried to deallocate the "large" memory pool.
  238.             This is an internal guru, shouldn't happen. 
  239.  
  240. ______________________________________________________________________________
  241.  
  242.                         The THOR-Software Licence
  243.  
  244.  
  245. This License applies to the computer programs known as "PoolMem", "ShowMem",
  246. "FragMeter", "MemoryMess" and "ShowMem".
  247. The "Program", below, refers to such program.
  248.  
  249.  
  250. The programs and files in this distribution are freely distributable
  251. under the restrictions stated below, but are also Copyright (c)
  252. Thomas Richter.
  253.  
  254.  
  255. Distribution of the Program by a commercial organization without written
  256. permission from the author to any third party is prohibited if any payment
  257. is made in connection with such distribution, whether directly
  258. (as in payment for a copy of the Program) or indirectly (as in payment
  259. for some service related to the Program, or payment for some product
  260. or service that includes a copy of the Program "without charge";
  261. these are only examples, and not an exhaustive enumeration of prohibited
  262. activities). However, the following methods of distribution involving
  263. payment shall not in and of themselves be a violation of this restriction:
  264.  
  265.  
  266. (i) Posting the Program on a public access information storage and
  267. retrieval service for which a fee is received for retrieving information
  268. (such as an on-line service), provided that the fee is not
  269. content-dependent (i.e., the fee would be the same for retrieving the same
  270. volume of information consisting of random data).
  271.  
  272.  
  273.  
  274. (ii) Distributing the Program on a CD-ROM, provided that the files
  275. containing the Program are reproduced entirely and verbatim on such
  276. CD-ROM, and provided further that all information on such CD-ROM be
  277. redistributable for non-commercial purposes without charge.
  278.  
  279.  
  280.  
  281. Everything in this distribution must be kept together, in original
  282. and unmodified form.
  283.  
  284.  
  285.  
  286.  
  287. Limitations.
  288.  
  289. THE PROGRAM IS PROVIDED TO YOU "AS IS," WITHOUT WARRANTY. THERE IS NO
  290. WARRANTY FOR THE PROGRAM, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
  291. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
  292. PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE
  293. RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD
  294. THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
  295. SERVICING, REPAIR OR CORRECTION.
  296.  
  297.  
  298.  
  299. IF YOU DO NOT ACCEPT THIS LICENCE, YOU MUST DELETE ALL FILES CONTAINED IN
  300. THIS ARCHIVE.
  301.  
  302. ______________________________________________________________________________
  303.  
  304. Have fun,
  305.     Thomas        March 1998
  306.