Difference between revisions of "FAQ: Understanding Memory"

From MIPAV
Jump to: navigation, search
(How much memory does MIPAV require to run?)
m (Videos)
 
(44 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=== How do I allocate more memory for MIPAV? ===
+
When MIPAV performs a function, such as visualizing an image file, it uses RAM on your computer. When you run MIPAV for the first time you must specify the maximum amount of memory (it calls the maximum heap size in the dialog box) that you would like to allocate for MIPAV, so it can take the full advantage of the memory resources available in your machine. The default value is 1000 MB. The amount of memory you can allocate to MIPAV is limited by how much RAM is installed on your system.
1 Select <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Help &gt; Memory Allocation</font>'''</span> in the MIPAV window. The Change Java.Runtime Memory Allocation dialog box (Figure 1) opens.<br />
+
  
{| border="1" cellpadding="5"
+
== User permissions ==
|+ '''Figure 1. Change Java.Runtime Memory Allocation dialog box'''
+
MIPAV’s memory allocation is a program-level feature and it affects all users of a given MIPAV installation. You can only change the amount of allocated memory, if you are running MIPAV using an administrative account.
 +
 
 +
== Memory limitations ==
 +
 
 +
{| class="wikitable" style="text-align: center; color: black;"
 
|-
 
|-
|
+
| '''OS'''
[[Image:dialogboxMemoryAllocation.jpg]]
+
| '''Max memory
 +
|-
 +
|Windows 32
 +
|1.3 GB
 +
|-
 +
|Windows 64
 +
|196 TB
 +
|-
 +
|Mac OS
 +
|196 TB
 +
|-
 +
|Linux 32
 +
|4 GB
 +
|-
 +
|Linux 64
 +
|196 TB
 
|}
 
|}
  
2 Change the Maximum heap size so that it reflects the maximum amount of desired memory to be allocated.<br />If additional memory is needed, MIPAV allocates it until the memory reaches the maximum heap size you entered.<br />
+
'''Comment:''' These memory allocations are limited by how much RAM is installed on your computer.
  
{| align="left"
+
== How can I allocate (more) memory for MIPAV? ==
|
+
[[Image:FAQMain.backup5.gif]]
+
|}
+
  
The maximum heap size should not exceed the amount of RAM installed on the computer. For example, if the computer has 512 Kb of RAM, a good number for the maximum heap size is 450 Kb, which leaves some space for the operating system and other applications.<br />
+
=== When you are installing MIPAV ===
3 Click <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">OK</font>'''</span>. The Restart Needed message (Figure 2) appears.<br />
+
  
{| border="1" cellpadding="5"
+
[[File:JvmMemoryLimit.png|500px|thumb|right|Installing MIPAV: the JVM Memory Limit tab]]
|+ '''Figure 2. Restart Needed message'''
+
|-
+
|
+
[[Image:messageRestartNeeded.jpg]]
+
|}
+
4 Do one of the following:<br />To close and restart MIPAV immediately, click <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Yes</font>'''</span>. MIPAV closes. In a moment, MIPAV starts again, and the memory changes take effect.<br />To postpone restarting MIPAV, click <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">No</font>'''</span>. The Restart Needed dialog box closes.<br />
+
  
{| align="left"
+
Starting [http://mipav.cit.nih.gov/download.php version 5.4.2] the easiest way to allocate memory in MIPAV is to do it when you are installing MIPAV. You can define the memory value in the JVM Memory Limit pane. The default value is set to 1000 MB. In the Pre-Installation summary pane, you can review memory settings, and then return back to the JVM Memory Limit pane and adjust them, if needed.
|
+
[[Image:FAQMain.backup36.gif]]
+
|}
+
  
If you click <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">No</font>'''</span>, the memory settings for MIPAV do <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">not</font>'''</span> change. To make the settings take effect, you must close and restart MIPAV.<br />
+
In case you figured out later that you need [[#HowMuchMemory | more memory]], you can still make adjustments using the Check java-runtime Memory Allocation dialog box [[#ChangeJava |options]]. See instructions provided for different operational systems below.
  
=== How much memory does MIPAV require to run? ===
 
  
MIPAV requires a base of at least 10 Mb of random access memory (RAM). However, to correctly display image files and to quantify the data, you need to allocate more memory, disk swap space, or install additional memory beyond this base. Each time MIPAV is installed, it always defaults to 100 Mb.
+
<div id="WindowsMemory"></div>
 +
=== Windows users: adjusting memory settings ===
 +
<div id="ChangeJava"></div>
 +
<ol>
 +
<li>Login to your computer under the administrative account, or under the user account who installed MIPAV. </li>
  
{| align="left"  
+
<li>Select Help &raquo; Memory allocation in the Main MIPAV window. The Check java-runtime Memory Allocation dialog box opens.</li>
| [[Image:FAQMain.backup7.gif]]  
+
 
|}
+
<li>In the dialog box, change the maximum heap size number so it reflects the maximum amount of memory you might need. Note that for Windows 32, there is a 1.3 GB limit for memory allocation.</li>
<br />
+
 
{| align="left"
+
 
|
+
[[File:MemoryAllocation.png|429px|thumb|center| The Change java-runtime Memory Allocation dialog box]]
[[Image:FAQMain.backup9.gif]]
+
 
|}
+
<li>Click OK to close the dialog box.</li>
<br />
+
 
 +
<li>You must restart of MIPAV for the changes to take effect. To exit MIPAV, select File &raquo; Exit. Then, restart the software.</li>
 +
</ol>
 +
 
 +
Now, when more memory is needed to perform a certain task, MIPAV allocates it until the memory reaches the maximum heap size you specified. You can also access this dialog anytime and change the memory allocation parameter as you wish.
 +
 
 +
<div id="LinuxMemory"></div>
 +
 
 +
=== Linux users: adjusting memory settings ===
 +
 
 +
To change the amount of memory allocated for MIPAV use, you need to run MIPAV using an account that has write-permission to the directory where MIPAV is installed, such as an administrator. The heap size is set in the mipav.lax file located in the directory where MIPAV is installed. E.g. <span style="font-family:courier">/usr/share/mipav </span>(and not within your own user mipav folder, e.g. <span style="font-family:courier">~/mipav</span>). Therefore, you need to run MIPAV with the appropriate permissions to modify files in that directory for the one time when you use the memory allocation tool.
 +
 
 +
<ol>
 +
<li> Login to your computer under the administrative account, or under the user account who installed MIPAV.</li>
 +
<li> Select Help &raquo; Memory Allocation in the Main MIPAV window. [[#ChangeJava | The Check java-runtime Memory Allocation dialog box]] opens.</li>
 +
<li> In the dialog box, change the maximum heap size number so it reflects the maximum amount of memory you might need.</li>
 +
<li> Click OK to close the dialog box.</li>
 +
<li> You must restart of MIPAV for the changes to take an effect. To exit MIPAV, select File &raquo; Exit. Then, restart the software.</li>
 +
</ol>
 +
 
 +
<div id="MacMemory"></div>
 +
 
 +
=== Mac OS users: adjusting memory settings ===
 +
 
 +
Follow the instructions provided to the [[#LinuxMemory | Linux users]]. The only difference is that in Mac OS the <span style="font-family:courier">mipav.lax</span> file is called <span style="font-family:courier">mipav.command.lax</span>, but it looks just the same.
 +
 
 +
<div id="MipavLax"></div>
 +
=== mipav.lax file ===
 +
 
 +
To adjust memory settings, MIPAV needs an access to the <span style="font-family:courier">mipav.lax</span> file located in the directory where MIPAV is installed. That’s why you need the appropriate permissions to make changes in this file. See also: [[MIPAV configuration files#LaunchAnywhere | MIPAV LAX files.]]  
 +
 
 +
'''mipav.lax file: the allocating memory section'''
 +
 
 +
<blockquote>
 +
LAX.NL.JAVA.OPTION.JAVA.HEAP.SIZE.INITIAL <br />
 +
 
 +
&#35;  ----------------------------------------- <br />
 +
 
 +
&#35;  Java start up heap size<br />
 +
 
 +
lax.nl.java.option.java.heap.size.initial=1048576000 <br />
 +
 
 +
&#35;  LAX.NL.JAVA.OPTION.JAVA.HEAP.SIZE.MAX <br />
 +
 
 +
&#35;  ------------------------------------- <br />
 +
 
 +
&#35;  Java maximum heap size <br />
 +
 
 +
lax.nl.java.option.java.heap.size.max=1048576000 <br />
 +
</blockquote>
 +
 
 +
Note: For Mac OS <span style="font-family:courier">mipav.lax file</span> is called <span style="font-family:courier">mipav.command.lax</span>, but it looks just the same.
 +
 
 +
=== Other situations ===
 +
[[File:OptionsMIpav.png|290px|thumb|right|The MIPAV Options dialog box]]
 +
 
 +
If you change the amount of allocated memory (the maximum heap size) and receive the following error message:
 +
<blockquote>
 +
"Heap size settings in the environment startup file either do not match those in the Preference file, or are non-existent. Memory Allocation will display so you can ensure this is correct." </blockquote>
 +
 
 +
And when you set a new number: in the Change java-runtime Memory Allocation dialog box, the following error message appears:
 +
 
 +
<blockquote>"Error writing to starting options file. No changes were made."</blockquote>
 +
 
 +
'''In order to fix that problem:'''
 +
 
 +
This is a common message when you have multiple versions of MIPAV installed on your computer and you switch between them. If you don’t want this warning to show up, you can avoid this by un-checking LAX/Preferences memory check option in the mipav.preferences file. This could be done via the MIPAV Options dialog box.
 +
 
 +
<ol>
 +
<li> Select Help &raquo; Mipav Options in the Main MIPAV window. The MIPAV Options dialog box opens.</li>
 +
<li> In the dialog box, go to the Other tab.</li>
 +
<li> Un-check the LAX/Preferences memory check box.</li>
 +
<li> Click Apply. The change will take place immediately.</li>
 +
</ol>
 +
 
 +
<div id="HowMuchMemory"></div>
 +
== How much memory does MIPAV require to run? ==
 +
 
 +
MIPAV requires a base of at least 10 Mb of random access memory (RAM). However, to correctly display image files and to quantify the data, you need to allocate more memory, use disk swap space, or install additional memory beyond this base. Each time MIPAV is installed, it always defaults to 100 Mb.
  
===What affects memory requirements? ===
+
=== What affects memory requirements? ===
  
 
Memory requirements fluctuate depending on the size and number of image files that are open at the same time. Factors affecting memory requirements are the following:
 
Memory requirements fluctuate depending on the size and number of image files that are open at the same time. Factors affecting memory requirements are the following:
 +
1) the physical size of image files (i.e., 1.2 Mb); 2) the number of images opened, because working on more than one image file at the same time requires more memory.
  
<div style="font-style: normal; font-weight: normal; margin-bottom: 14pt; margin-left: 18pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000">  <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Size of image files:</font>'''</span> The physical size of image files (i.e., 1.2 Mb)<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 14pt; margin-left: 18pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000">  <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Number of image files opened:</font>'''</span> Working on more than one image file at the same time<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 12pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000"><br clear="all" /> {| align="left" | [[Image:FAQMain.backup11.gif]] |} <br clear="all" />Note:</font>'''</span><span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000"> </font></span>Java provides a method called Garbage Collector that clears all unnecessarily reserved memory. Generally, the software does this automatically, when free memory becomes very limited. However, you can run the Garbage Collector at any time to free memory (refer to [FAQMain.backup.html#1002914 "How do I free memory?" ]). <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-indent: 0pt; text-transform: none; vertical-align: baseline"><u><font color="#ff1621"> [FAQMain.backup.html#998290 [[Image:FAQMain.backupa.gif]] ][FAQMain.backup.html#998290  Back to Questions]<br /></font></u></div>
+
'''Note:'''Java provides a method called Garbage Collector that clears all unnecessarily reserved memory. Generally, the software does this automatically, when free memory becomes very limited. However, you can run the Garbage Collector at any time to free memory (refer to [[#HowFreeMemory | How can I free memory?]] ). <br />
  
=== How do I determine the amount of additional memory needed? ===
+
<div id="MemoryNeeded"></div>
 +
=== How can I determine the amount of additional memory needed? ===
  
<div style="font-style: normal; margin-bottom: 6pt; margin-left: 0pt; margin-right: 0pt; margin-top: 14pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline">'''<font color="#000000"> To determine the amount of additional memory needed<br /></font>'''</div><div style="font-style: normal; font-weight: normal; margin-bottom: 14pt; margin-left: 18pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1 Multiply the size of the largest image file that you want to process by 10. <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 14pt; margin-left: 18pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 2 Multiply the results by the number of image files that you want to display simultaneously.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 14pt; margin-left: 18pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 3 Add this amount to the 10-Mb base memory to result in the total amount of memory typically needed.`<br /></font></div>
+
To determine the amount of additional memory needed:
 +
<ol>
 +
<li> Multiply the size of the largest image file that you want to process by 10.</li>
 +
<li>Multiply the results by the number of image files that you want to display simultaneously.</li>
 +
<li> Add this amount to the 10-Mb base memory to result in the total amount of memory typically needed.</li>
 +
</ol>
  
==== Example 1 ====
+
==== Example 1: Memory calculation====  
  
 
If an image file is 2 Mb and you only want to display one image file at a time, you must allocate an additional 20 Mb of RAM to the base memory of 10 Mb to result in a memory requirement of 30 Mb.
 
If an image file is 2 Mb and you only want to display one image file at a time, you must allocate an additional 20 Mb of RAM to the base memory of 10 Mb to result in a memory requirement of 30 Mb.
  
<div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 2 Mb Size of image file<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> x 10 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <nowiki>------</nowiki><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 20 Mb Memory required for displaying and processing 1 image file<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000">  10 Mb Base memory required for running MIPAV<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <nowiki>------</nowiki><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000">  30 Mb Total memory required<br /></font></div>
+
<blockquote>
 +
2 Mb Size of image file x 10
 +
<hr width="20%" />
 +
20 Mb Memory required for displaying and processing 1 image file
  
==== Example 2 ====
+
+
 +
 
 +
10 Mb Base memory required for running MIPAV
 +
<hr width="20%" />
 +
30 Mb Total memory required
 +
</blockquote>
 +
 
 +
==== Example 2: Memory calculation ====
  
 
If the largest size image file is 2 Mb and you want to display 3 image files simultaneously, multiply 2 Mb by 10. Then multiply that sum by 3. Add that total to the base memory of 10 Mb to yield a memory requirement of 70 Mb.
 
If the largest size image file is 2 Mb and you want to display 3 image files simultaneously, multiply 2 Mb by 10. Then multiply that sum by 3. Add that total to the base memory of 10 Mb to yield a memory requirement of 70 Mb.
  
<div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 2 Mb Largest size image file<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> x 10 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <nowiki>------</nowiki><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 20 Mb Memory required for displaying 1 image file<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> x 3 Number of images to display and process simultaneously<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <nowiki>------</nowiki><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 60 Mb Memory required to display 3 image files<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000">  10 Mb Base memory required for running MIPAV<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <nowiki>------</nowiki><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000">  70 Mb Total memory required<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-indent: 0pt; text-transform: none; vertical-align: baseline"><u><font color="#ff1621">
+
<blockquote>
 +
2 Mb Largest size image file x 10
 +
<hr width="20%" />
 +
20 Mb Memory required for displaying 1 image file
 +
x 3 Number of images to display and process simultaneously
 +
<hr width="20%" />
 +
60 Mb Memory required to display 3 image files
  
=== How do I determine how much memory is currently being used? ===
+
+
  
In the MIPAV window, select <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Help &gt; Memory Usage</font>'''</span>. The Memory Monitor dialog box (Figure 3]) appears.
+
10 Mb Base memory required for running MIPAV
 +
<hr width="20%" />
 +
70 Mb Total memory required
 +
</blockquote>
  
{| border="1" cellpadding="5"
+
=== How can I determine how much memory is currently being used? ===
|+ '''Figure 3. Memory Monitor dialog box'''
+
[[File:MemoryUsage.jpg|400px|thumb|right|The Memory Monitor dialog box]]
|-
+
|
+
[[Image:dialogboxMemoryMonitor.jpg]]
+
|}
+
  
The Memory Monitor dialog box shows how much memory is allocated and the amount of memory that is being used. The graph displays a pictorial representation of the ratio of allocated memory and amount of memory used. It shows the memory usage during the past 3 minutes and 45 seconds.
+
In the main MIPAV window, select Help &raquo; Memory Usage (or press '''Ctrl+M'''). The Memory Monitor dialog box appears. The dialog box shows how much memory is allocated and the amount of memory that is being used. The graph displays a pictorial representation of the ratio of allocated memory and amount of memory used. It shows the memory usage during the past 3 minutes and 45 seconds.
  
<div style="font-style: normal; font-weight: normal; margin-bottom: 12pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#000000"><br clear="all" />
+
'''Note: '''You can leave this window open if you want to constantly monitor your memory resources.<br />
  
{| align="left"
+
<div id="HowFreeMemory"></div>
|
+
 
[[Image:FAQMain.backup17.gif]]
+
== How can I free memory? ==
|}
+
 
 +
 
 +
[[File:GarbageCollector.jpg|frameless]] As Java-based programs run, they often leave old variables, objects, or constructors in memory. For instance, if you delineate a VOI, the coordinates of the contours may remain in memory even after you close the image. Java provides a method called the ''garbage collector'' (or ''memory recycling'') that automatically freeing objects that are no longer referenced by the program and clears all unnecessarily reserved memory. Generally, the software does this automatically when free memory becomes very limited. However, you can run the garbage collector at any time to free memory by clicking the Garbage Collector button.
 +
 
 +
=== To free memory, do the following procedure periodically: ===
 +
 
 +
<ul>
 +
<li> Click the Garbage Collector button on the main MIPAV window.</li>
 +
<li> Select Help &raquo; Memory Usage in the main MIPAV window. The Memory Monitor dialog box appears. Click Free Memory. The system clears all unnecessarily reserved memory.</li>
 +
</ul>
  
<br clear="all" /></font></span><span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Note: </font>'''</span>You can leave this window open if you want to constantly monitor your memory resources.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-indent: 0pt; text-transform: none; vertical-align: baseline"><u><font color="#ff1621">
 
  
=== How do I free memory? ===
+
== Videos ==
 +
This video tutorial explains how to load images into MIPAV and change the memory allocation - [http://www.youtube.com/embed/npSYWYJa530 play].
  
The Garbage Collector allows you to delete unnecessarily reserved memory. To free memory, do the following procedure periodically:
+
== See also: ==
 +
*[[Getting Started Quickly with MIPAV]]
 +
*[[Allocating Memory in MIPAV]]
 +
*[[Opening and loading image files]]
  
<div style="font-style: normal; font-weight: normal; margin-bottom: 14pt; margin-left: 18pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1 Select <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Help &gt; Memory Usage</font>'''</span> in the MIPAV window. The Memory Monitor dialog box ([FAQMain.backup.html#1041395 Figure 3]) appears.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 14pt; margin-left: 18pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 2 Click <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">Free Memory</font>'''</span>. The system clears all unnecessarily reserved memory.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-indent: 0pt; text-transform: none; vertical-align: baseline"><u><font color="#ff1621"> [FAQMain.backup.html#998290 [[Image:FAQMain.backup8.gif]] ][FAQMain.backup.html#998290  Back to Questions]<br /></font></u></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000">
+
Next: [[FAQ: Customizing MIPAV]]
  
 +
[[Category: Help]]
  
[[FAQ: Customizing MIPAV]]
+
[[Category: FAQ]]

Latest revision as of 17:32, 18 May 2012

When MIPAV performs a function, such as visualizing an image file, it uses RAM on your computer. When you run MIPAV for the first time you must specify the maximum amount of memory (it calls the maximum heap size in the dialog box) that you would like to allocate for MIPAV, so it can take the full advantage of the memory resources available in your machine. The default value is 1000 MB. The amount of memory you can allocate to MIPAV is limited by how much RAM is installed on your system.

User permissions

MIPAV’s memory allocation is a program-level feature and it affects all users of a given MIPAV installation. You can only change the amount of allocated memory, if you are running MIPAV using an administrative account.

Memory limitations

OS Max memory
Windows 32 1.3 GB
Windows 64 196 TB
Mac OS 196 TB
Linux 32 4 GB
Linux 64 196 TB

Comment: These memory allocations are limited by how much RAM is installed on your computer.

How can I allocate (more) memory for MIPAV?

When you are installing MIPAV

Installing MIPAV: the JVM Memory Limit tab

Starting version 5.4.2 the easiest way to allocate memory in MIPAV is to do it when you are installing MIPAV. You can define the memory value in the JVM Memory Limit pane. The default value is set to 1000 MB. In the Pre-Installation summary pane, you can review memory settings, and then return back to the JVM Memory Limit pane and adjust them, if needed.

In case you figured out later that you need more memory, you can still make adjustments using the Check java-runtime Memory Allocation dialog box options. See instructions provided for different operational systems below.


Windows users: adjusting memory settings

  1. Login to your computer under the administrative account, or under the user account who installed MIPAV.
  2. Select Help » Memory allocation in the Main MIPAV window. The Check java-runtime Memory Allocation dialog box opens.
  3. In the dialog box, change the maximum heap size number so it reflects the maximum amount of memory you might need. Note that for Windows 32, there is a 1.3 GB limit for memory allocation.

  4. The Change java-runtime Memory Allocation dialog box
  5. Click OK to close the dialog box.
  6. You must restart of MIPAV for the changes to take effect. To exit MIPAV, select File » Exit. Then, restart the software.

Now, when more memory is needed to perform a certain task, MIPAV allocates it until the memory reaches the maximum heap size you specified. You can also access this dialog anytime and change the memory allocation parameter as you wish.

Linux users: adjusting memory settings

To change the amount of memory allocated for MIPAV use, you need to run MIPAV using an account that has write-permission to the directory where MIPAV is installed, such as an administrator. The heap size is set in the mipav.lax file located in the directory where MIPAV is installed. E.g. /usr/share/mipav (and not within your own user mipav folder, e.g. ~/mipav). Therefore, you need to run MIPAV with the appropriate permissions to modify files in that directory for the one time when you use the memory allocation tool.

  1. Login to your computer under the administrative account, or under the user account who installed MIPAV.
  2. Select Help » Memory Allocation in the Main MIPAV window. The Check java-runtime Memory Allocation dialog box opens.
  3. In the dialog box, change the maximum heap size number so it reflects the maximum amount of memory you might need.
  4. Click OK to close the dialog box.
  5. You must restart of MIPAV for the changes to take an effect. To exit MIPAV, select File » Exit. Then, restart the software.

Mac OS users: adjusting memory settings

Follow the instructions provided to the Linux users. The only difference is that in Mac OS the mipav.lax file is called mipav.command.lax, but it looks just the same.

mipav.lax file

To adjust memory settings, MIPAV needs an access to the mipav.lax file located in the directory where MIPAV is installed. That’s why you need the appropriate permissions to make changes in this file. See also: MIPAV LAX files.

mipav.lax file: the allocating memory section

LAX.NL.JAVA.OPTION.JAVA.HEAP.SIZE.INITIAL

# -----------------------------------------

# Java start up heap size

lax.nl.java.option.java.heap.size.initial=1048576000

# LAX.NL.JAVA.OPTION.JAVA.HEAP.SIZE.MAX

# -------------------------------------

# Java maximum heap size

lax.nl.java.option.java.heap.size.max=1048576000

Note: For Mac OS mipav.lax file is called mipav.command.lax, but it looks just the same.

Other situations

The MIPAV Options dialog box

If you change the amount of allocated memory (the maximum heap size) and receive the following error message:

"Heap size settings in the environment startup file either do not match those in the Preference file, or are non-existent. Memory Allocation will display so you can ensure this is correct."

And when you set a new number: in the Change java-runtime Memory Allocation dialog box, the following error message appears:

"Error writing to starting options file. No changes were made."

In order to fix that problem:

This is a common message when you have multiple versions of MIPAV installed on your computer and you switch between them. If you don’t want this warning to show up, you can avoid this by un-checking LAX/Preferences memory check option in the mipav.preferences file. This could be done via the MIPAV Options dialog box.

  1. Select Help » Mipav Options in the Main MIPAV window. The MIPAV Options dialog box opens.
  2. In the dialog box, go to the Other tab.
  3. Un-check the LAX/Preferences memory check box.
  4. Click Apply. The change will take place immediately.

How much memory does MIPAV require to run?

MIPAV requires a base of at least 10 Mb of random access memory (RAM). However, to correctly display image files and to quantify the data, you need to allocate more memory, use disk swap space, or install additional memory beyond this base. Each time MIPAV is installed, it always defaults to 100 Mb.

What affects memory requirements?

Memory requirements fluctuate depending on the size and number of image files that are open at the same time. Factors affecting memory requirements are the following: 1) the physical size of image files (i.e., 1.2 Mb); 2) the number of images opened, because working on more than one image file at the same time requires more memory.

Note:Java provides a method called Garbage Collector that clears all unnecessarily reserved memory. Generally, the software does this automatically, when free memory becomes very limited. However, you can run the Garbage Collector at any time to free memory (refer to How can I free memory? ).

How can I determine the amount of additional memory needed?

To determine the amount of additional memory needed:

  1. Multiply the size of the largest image file that you want to process by 10.
  2. Multiply the results by the number of image files that you want to display simultaneously.
  3. Add this amount to the 10-Mb base memory to result in the total amount of memory typically needed.

Example 1: Memory calculation

If an image file is 2 Mb and you only want to display one image file at a time, you must allocate an additional 20 Mb of RAM to the base memory of 10 Mb to result in a memory requirement of 30 Mb.

2 Mb Size of image file x 10


20 Mb Memory required for displaying and processing 1 image file

+

10 Mb Base memory required for running MIPAV


30 Mb Total memory required

Example 2: Memory calculation

If the largest size image file is 2 Mb and you want to display 3 image files simultaneously, multiply 2 Mb by 10. Then multiply that sum by 3. Add that total to the base memory of 10 Mb to yield a memory requirement of 70 Mb.

2 Mb Largest size image file x 10


20 Mb Memory required for displaying 1 image file x 3 Number of images to display and process simultaneously


60 Mb Memory required to display 3 image files

+

10 Mb Base memory required for running MIPAV


70 Mb Total memory required

How can I determine how much memory is currently being used?

The Memory Monitor dialog box

In the main MIPAV window, select Help » Memory Usage (or press Ctrl+M). The Memory Monitor dialog box appears. The dialog box shows how much memory is allocated and the amount of memory that is being used. The graph displays a pictorial representation of the ratio of allocated memory and amount of memory used. It shows the memory usage during the past 3 minutes and 45 seconds.

Note: You can leave this window open if you want to constantly monitor your memory resources.

How can I free memory?

GarbageCollector.jpg As Java-based programs run, they often leave old variables, objects, or constructors in memory. For instance, if you delineate a VOI, the coordinates of the contours may remain in memory even after you close the image. Java provides a method called the garbage collector (or memory recycling) that automatically freeing objects that are no longer referenced by the program and clears all unnecessarily reserved memory. Generally, the software does this automatically when free memory becomes very limited. However, you can run the garbage collector at any time to free memory by clicking the Garbage Collector button.

To free memory, do the following procedure periodically:

  • Click the Garbage Collector button on the main MIPAV window.
  • Select Help » Memory Usage in the main MIPAV window. The Memory Monitor dialog box appears. Click Free Memory. The system clears all unnecessarily reserved memory.


Videos

This video tutorial explains how to load images into MIPAV and change the memory allocation - play.

See also:

Next: FAQ: Customizing MIPAV