Difference between revisions of "FAQ: Understanding Memory"
m (→I edited that topic and added more information about memory allocation from MIPAV listserv) |
m |
||
Line 32: | Line 32: | ||
=== How can I allocate (more) memory for MIPAV? === | === How can I allocate (more) memory for MIPAV? === | ||
− | + | ==== When you are installing MIPAV ==== | |
Starting version 5.4.2 (TBD) the easiest way to allocate memory in MIPAV is to do it when you are installing MIPAV. You can select the memory value in the JVM Memory Limit pane. The default value is set to 1000 MB. | Starting version 5.4.2 (TBD) the easiest way to allocate memory in MIPAV is to do it when you are installing MIPAV. You can select the memory value in the JVM Memory Limit pane. The default value is set to 1000 MB. | ||
+ | [[File:JvmMemoryLimit.jpg|200px|thumb|right|Installing MIPAV: the JVM Memory Limit tab]] | ||
+ | <div id="WindowsMemory"></div> | ||
+ | ==== Windows users: adjusting memory settings ==== | ||
+ | |||
+ | <ol> | ||
+ | <li>Login to your computer under the administrative account, or under the user account who installed MIPAV. </li> | ||
+ | |||
+ | <li>Select Help > Memory allocation in the Main MIPAV window. The Change 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. Note that for Windows 32, there is a 1.3 GB limit for memory allocation.</li> | ||
+ | |||
+ | <div id="ChangeJava"></div> | ||
+ | |||
+ | [[File:MemoryAllocation.jpg|429px|thumb|center| The Change java-runtime Memory Allocation dialog box]] | ||
+ | |||
+ | <li>Click OK to close the dialog box.</li> | ||
+ | |||
+ | <li>You must restart of MIPAV for the changes to take effect. To exit MIPAV, select File > 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 > Memory allocation in the Main MIPAV window. [[#ChangeJava | The Change 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 > 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 /> | ||
+ | |||
+ | # ----------------------------------------- <br /> | ||
+ | |||
+ | # Java start up heap size<br /> | ||
+ | |||
+ | lax.nl.java.option.java.heap.size.initial=1048576000 <br /> | ||
+ | |||
+ | # LAX.NL.JAVA.OPTION.JAVA.HEAP.SIZE.MAX <br /> | ||
+ | |||
+ | # ------------------------------------- <br /> | ||
+ | |||
+ | # 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. | ||
Revision as of 14:57, 10 April 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.
Contents
- 1 User permissions
- 2 Memory limitations
- 3 How can I allocate (more) memory for MIPAV?
- 4 mipav.lax file
- 5 How much memory does MIPAV require to run?
- 6 What affects memory requirements?
- 7 How do I determine the amount of additional memory needed?
- 8 How do I determine how much memory is currently being used?
- 9 How do I free memory?
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
Starting version 5.4.2 (TBD) the easiest way to allocate memory in MIPAV is to do it when you are installing MIPAV. You can select the memory value in the JVM Memory Limit pane. The default value is set to 1000 MB.
Windows users: adjusting memory settings
- Login to your computer under the administrative account, or under the user account who installed MIPAV.
- Select Help > Memory allocation in the Main MIPAV window. The Change java-runtime Memory Allocation dialog box opens.
- 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.
- Click OK to close the dialog box.
- 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.
- Login to your computer under the administrative account, or under the user account who installed MIPAV.
- Select Help > Memory allocation in the Main MIPAV window. The Change java-runtime Memory Allocation dialog box opens.
- In the dialog box, change the maximum heap size number so it reflects the maximum amount of memory you might need.
- Click OK to close the dialog box.
- 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.
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.
File:FAQMain.backup7.gif |
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:
File:FAQMain.backup11.gif |
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 do I free memory?" ).
How do I determine the amount of additional memory needed?
Example 1
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.
Example 2
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.
10 Mb Base memory required for running MIPAV
70 Mb Total memory required
How do I determine how much memory is currently being used?
In the MIPAV window, select Help > Memory Usage. The Memory Monitor dialog box (Figure 3) appears.
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.
Note: You can leave this window open if you want to constantly monitor your memory resources.
How do I free memory?
The Garbage Collector allows you to delete unnecessarily reserved memory. To free memory, do the following procedure periodically:
<1 Select Help > Memory Usage in the MIPAV window. The Memory Monitor dialog box (Figure 3) appears.
2 Click Free Memory. The system clears all unnecessarily reserved memory.