Difference between revisions of "AMOSi:Lowering memory usage"

From Amiga Coding
Jump to: navigation, search
(Extracted from the AMOSPro V2.00 helpfile)
(added headers to give better structure)
 
Line 5: Line 5:
  
  
* AMOS Professional has a built-in low memory protection system that helps you avoid using up memory.
+
==Low memory protection system==
 +
AMOS Professional has a built-in low memory protection system that helps you avoid using up memory.
  
  
Line 14: Line 15:
  
  
<code><pre>
+
* the Default screen (if open).
- the Default screen (if open).
+
* any open maths libraries (if they are not needed anymore)
- any open maths libraries (if they are not needed anymore)
+
* the Undo buffers
- the Undo buffers
+
* the directory Stored in the File Selector
- the directory Stored in the File Selector
+
 
</pre></code>
 
  
 
If Pro can than access more than 72k it will allow the menus to be opened.
 
If Pro can than access more than 72k it will allow the menus to be opened.
  
  
* You may find that some programs will fail under AMOS Pro and yet work fine in old AMOS. Obviously AMOS Pro's new Editor and features take up more memory. So to free up memory when your programs run try these techniques:
+
==Freeing memory yourself==
 
+
You may find that some programs will fail under AMOS Pro and yet work fine in old AMOS. Obviously AMOS Pro's new Editor and features take up more memory. So to free up memory when your programs run try these techniques:
 
 
- The Close Editor command will free a considerable amount of memory but will still leave you with a 50k overhead compared to old AMOS.
 
  
  
- Using the new Kill Editor command will free so much memory that you'll have 32k more to play with than was possible in old AMOS. The bad news is you'll have to wait for the editor to load after each run.
+
* The Close Editor command will free a considerable amount of memory but will still leave you with a 50k overhead compared to old AMOS.
 +
* Using the new Kill Editor command will free so much memory that you'll have 32k more to play with than was possible in old AMOS. The bad news is you'll have to wait for the editor to load after each run.
  
  
Some programs that use Kill Editor may ask for lots of memory by<br /> reserving banks and opening screens. Once the program has finished, AMOS Pro attempts to reload the Editor. It will first ask you to insert the System disc so that it can find the Editor files and then attempt to load it.
+
Some programs that use Kill Editor may ask for lots of memory by reserving banks and opening screens. Once the program has finished, AMOS Pro attempts to reload the Editor. It will first ask you to insert the System disc so that it can find the Editor files and then attempt to load it.
  
  
Line 48: Line 47:
  
  
Losing the File Selector Stored Directories<br /> ------------------------------------------- If you find the Store option has been erased this will be due to a memory flush that occured earlier in your programming.
+
==Losing the File Selector Stored Directories==
<br />
+
If you find the Store option has been erased this will be due to a memory flush that occured earlier in your programming.

Latest revision as of 20:08, 17 November 2007

AMOS Professional does its best to give you as much available memory as possible. But at the end of the day AMOS Professional is a huge program with many memory requirements. So we'll point you in the right direction by offering the following advice:


  • A Multitasking machine in its own nature needs to have spare memory to operate properly. So you must ensure that at least 32k memory is left free for the system's own needs. Trying to grab all the memory is just too risky.


Low memory protection system

AMOS Professional has a built-in low memory protection system that helps you avoid using up memory.


If you find the Editor's drop down menus cannot be accessed, it's because there's less than 72k available and AMOS Professional needs more to open them. If you let this happen you are still able to use the keyboard short-cuts.


AMOS Professional also has a memory grabber. When Pro detects less than 72k is available it will erase the following until more than 72k is freed:


  • the Default screen (if open).
  • any open maths libraries (if they are not needed anymore)
  • the Undo buffers
  • the directory Stored in the File Selector


If Pro can than access more than 72k it will allow the menus to be opened.


Freeing memory yourself

You may find that some programs will fail under AMOS Pro and yet work fine in old AMOS. Obviously AMOS Pro's new Editor and features take up more memory. So to free up memory when your programs run try these techniques:


  • The Close Editor command will free a considerable amount of memory but will still leave you with a 50k overhead compared to old AMOS.
  • Using the new Kill Editor command will free so much memory that you'll have 32k more to play with than was possible in old AMOS. The bad news is you'll have to wait for the editor to load after each run.


Some programs that use Kill Editor may ask for lots of memory by reserving banks and opening screens. Once the program has finished, AMOS Pro attempts to reload the Editor. It will first ask you to insert the System disc so that it can find the Editor files and then attempt to load it.


If this fails due to low memory, AMOS Pro will clear all variables, the screens etc.


If it still fails a small requester will appear that asks if you want to erase the memory banks - this should be plenty for the editor to load, if not you'll be dumped into the Workbench.


So when you program in a low memory state, ensure your program erases the banks before going back to the editor.


A memory expansion would be the best solution if you find yourself always programming around low memory conditions!


Losing the File Selector Stored Directories

If you find the Store option has been erased this will be due to a memory flush that occured earlier in your programming.