Difference between revisions of "Memory usage"

 
(5 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
[[Category: Windows and dialogs]]
 
[[Category: Windows and dialogs]]
  
<breadcrumbs> Analytica User Guide > Appendices > {{PAGENAME}}</breadcrumbs><br />
+
<breadcrumbs> Analytica User Guide > Reference sections> {{PAGENAME}}</breadcrumbs><br />
  
 
The '''Memory Usage''' window displays the amount of memory available on your system, as well as the memory currently in use by all applications, including Windows itself. The memory available on your system is the sum of all physical memory installed on your system and the pagefile on your hard disk, which is used to complement the physical memory.
 
The '''Memory Usage''' window displays the amount of memory available on your system, as well as the memory currently in use by all applications, including Windows itself. The memory available on your system is the sum of all physical memory installed on your system and the pagefile on your hard disk, which is used to complement the physical memory.
  
To display the '''Memory Usage''' window, select '''Show Memory Usage''' from the '''Window''' menu. The memory usage displays in two sizes, depending on whether you check Expanded View. The expanded view contains a large number of memory statistics.
+
To display the '''Memory Usage''' window, select '''Show Memory Usage''' from the [[Window menu]]. The memory usage displays in two sizes, depending on whether you check Expanded View. The expanded view contains a large number of memory statistics.
  
 
:[[File:memory.png|600px]]
 
:[[File:memory.png|600px]]
Line 14: Line 14:
 
:[[File:memory_2.png|800px]]
 
:[[File:memory_2.png|800px]]
  
If you require additional memory to run your model at a given sample size, you can take several steps to increase the amount of memory available to Analytica:
+
==== What if you run out of memory? ====
# Close other open applications.
+
 
:: All applications require a segment of memory to operate, and this reduces the memory available to Analytica.  
+
What can you do if your model exhausts the RAM on your computer? Here are some options:
<ol start="2"><li> Increase the size of your computer’s page file. </li></ol>
+
* Close open applications that you don't need to free up memory for Analytica.
<ol start="3"><li> Analytica is a 32-bit process, and like all 32-bit process, the Windows operating system limits the maximum amount of memory that can be used by a 32-bit process to a default limit of 2GB. In Windows XP and Vista, this limit can be increased to 3GB by editing the system file <code>C:\boot.ini</code>. For the line corresponding to your operating in that file, append /3GB and /USERVA options. For example, after your edit, the line may be: </li></ol>
+
 
 +
* If your model has uncertain variables, you can reduce the [[Sample size]].  For exploratory runs, a sample size of only 50 or 100 can provide good insights. If you need larger sample size for final results, try the [[Large Sample Library: User Guide|Large Sample Library]] which runs a model many times with a small sample size and combines the results for viewing and analysis.
 +
 
 +
* There are often simple ways to modify a model to reduce memory usage. Often just a handful of variables use most of the memory. Use the [[Performance Profiler library]]  (requires [[Analytica Enterprise]] or Optimizer) to find out which variables or functions use most memory (and computation time). Then you can focus on those variables to see if there is a way to reduce the dimensions (indexes). For example, it may generate an intermediate array that takes a lot of memory with a result that is much smaller because it sums, or otherwise aggregates or selects over a dimension.  Sometimes you can put in an explicit iteration loop (which may take more time to compute but less memory)
 +
 
 +
* By default, Analytica caches -- i.e. stores -- the value of every variable after computing it. This favors speed of computation over memory use. You can tell it not to [[Controlling When Result Values Are Cached|cache]] selected variables. Best to do this for variables that use a lot of memory but are only needed by one result.
 +
 
 +
* Consider adding memory to your computer. RAM is ever cheaper. (This won't help if you have a 32-bit Windows OS.)
 +
 
 +
* Increase the size of your computer’s page file used for virtual memory. Using virtual memory that can slow down the computation.  It helps to use a solid state disk (SSD) which is much faster then a conventional hard disk.
 +
 
 +
*  [mailto:support@lummina.com Ask Lumina] for advice.  
 +
 
 +
* If you have a 32-bit Windows OS (and 32-bit version of Analytica), Windows limits the maximum amount of memory that can be used by a 32-bit process to a default limit of 2GB. Since Windows XP, you can increase this limit to 3GB by editing the system file <code>C:\boot.ini</code>. For the line corresponding to your operating in that file, append /3GB and /USERVA options. For example, after your edit, the line may be: </li></ol>
 
::: <code>multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows XP"/3GB/USERVA</code>  
 
::: <code>multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows XP"/3GB/USERVA</code>  
::After making the edit, a system reboot is required for this to take effect.  
+
::After making the edit, you need to reboot the system for this to take effect.  
<ol start="4"><li> Consider adding more physical memory to your computer. </li></ol>
 
:: If you are limited by the 3GB per process ceiling, then adding more memory will not increase available space, although it may speed up execution when other applications are also open. Analytica 64-bit will directly benefit from any RAM you add.
 
<ol start="5"><li> Add a solid-state drive to your computer and locate your page file on it. </li></ol>
 
<ol start="6"><li> Consider ways to reorganize your model. Are there dimensions that can be removed from the model, or especially from problematic high-dimensional results. The Performance Profiler (in [[Analytica Enterprise]]) can help you pinpoint variables that consume a lot of memory.</li></ol> <br />
 
  
For additional ideas for coping with memory limitations, see [[Managing Memory and CPU Time for large models]].
+
* For more ideas for coping with memory limitations, see [[Managing Memory and CPU Time for large models]].
  
 
==See Also==
 
==See Also==

Latest revision as of 19:38, 27 June 2020



The Memory Usage window displays the amount of memory available on your system, as well as the memory currently in use by all applications, including Windows itself. The memory available on your system is the sum of all physical memory installed on your system and the pagefile on your hard disk, which is used to complement the physical memory.

To display the Memory Usage window, select Show Memory Usage from the Window menu. The memory usage displays in two sizes, depending on whether you check Expanded View. The expanded view contains a large number of memory statistics.

Memory.png
Tip
The above window appears automatically when Analytica runs low on memory.
Memory 2.png

What if you run out of memory?

What can you do if your model exhausts the RAM on your computer? Here are some options:

  • Close open applications that you don't need to free up memory for Analytica.
  • If your model has uncertain variables, you can reduce the Sample size. For exploratory runs, a sample size of only 50 or 100 can provide good insights. If you need larger sample size for final results, try the Large Sample Library which runs a model many times with a small sample size and combines the results for viewing and analysis.
  • There are often simple ways to modify a model to reduce memory usage. Often just a handful of variables use most of the memory. Use the Performance Profiler library (requires Analytica Enterprise or Optimizer) to find out which variables or functions use most memory (and computation time). Then you can focus on those variables to see if there is a way to reduce the dimensions (indexes). For example, it may generate an intermediate array that takes a lot of memory with a result that is much smaller because it sums, or otherwise aggregates or selects over a dimension. Sometimes you can put in an explicit iteration loop (which may take more time to compute but less memory)
  • By default, Analytica caches -- i.e. stores -- the value of every variable after computing it. This favors speed of computation over memory use. You can tell it not to cache selected variables. Best to do this for variables that use a lot of memory but are only needed by one result.
  • Consider adding memory to your computer. RAM is ever cheaper. (This won't help if you have a 32-bit Windows OS.)
  • Increase the size of your computer’s page file used for virtual memory. Using virtual memory that can slow down the computation. It helps to use a solid state disk (SSD) which is much faster then a conventional hard disk.
  • If you have a 32-bit Windows OS (and 32-bit version of Analytica), Windows limits the maximum amount of memory that can be used by a 32-bit process to a default limit of 2GB. Since Windows XP, you can increase this limit to 3GB by editing the system file C:\boot.ini. For the line corresponding to your operating in that file, append /3GB and /USERVA options. For example, after your edit, the line may be:
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows XP"/3GB/USERVA
After making the edit, you need to reboot the system for this to take effect.

See Also


Comments


You are not allowed to post comments.