1cb9596456117941b2b36f4ee20489f60bbdae11
[jalview.git] / help / html / memory.html
1 <html>
2 <!--
3  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
4  * Copyright (C) 2014 The Jalview Authors
5  * 
6  * This file is part of Jalview.
7  * 
8  * Jalview is free software: you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License 
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *  
13  * Jalview is distributed in the hope that it will be useful, but 
14  * WITHOUT ANY WARRANTY; without even the implied warranty 
15  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
16  * PURPOSE.  See the GNU General Public License for more details.
17  * 
18  * You should have received a copy of the GNU General Public License
19  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
20  * The Jalview Authors are detailed in the 'AUTHORS' file.
21  -->
22 <head><title>Memory Settings</title></head>
23 <body>
24 <h2>
25   <center>
26     <strong>Memory Usage Settings for Jalview</strong>
27   </center>
28 </h2>
29 <p>Jalview sometimes runs out of memory. This is because of the way that Java
30   runs on a computer - what is actually run is a program called a virtual machine
31   (the JVM) which executes the java instructions. The JVM has limits on the memory
32   that can be allocated to the java program - and you might need to increase them
33   if you are working with particularly large datasets.<br>
34   If Jalview has not explicitly told you that it has run out of memory, then a
35   common sign is that a function that normally works seems to have no effect when
36   working with a larger set of sequences (this might include open dialog boxes
37   for saving PNG files, or when interpreting the result of a web service calculation).</p>
38   <p><em>Jalview Memory Usage Monitor</em>: If you are concerned about memory, or think that things might be behaving 
39   strangely because of a shortage of memory, then you can check this by enabling the 
40   memory usage monitor. This is done by selecting the <strong>Tools&#8594;Show Memory Usage</strong>
41   option. Once enabled, the memory usage monitor displays the currently 
42   available memory, the total memory, and the percentage free at the 
43   bottom left hand side of the Jalview Desktop window's background.</p>
44 <p><em>Increasing the memory available to Jalview</em><br>
45 The way you increase the memory settings for the JVM depends on which installation
46   of Jalview you use:</p>
47 <ul>
48                 <li><em><font size="3">Web Start Version</font></em>
49                         <p>
50                                 JavaWS sets the JVM parameters through special tags in the JNLP
51                                 file. You can obtain a JNLP file with modified memory settings from
52                                 our service with the following link (replace 2G with desired memory
53                                 in G or M):<br /> <a
54                                         href="http://www.jalview.org/services/launchApp?jvm-max-heap=2G">http://www.jalview.org/services/launchApp?jvm-max-heap=2G</a>
55                         </p>
56                         <p>
57                                 Alternatively, if you want to create your own JNLP file then please
58                                 download the latest JNLP file from <a
59                                         href="http://www.jalview.org/webstart/jalview.jnlp">http://www.jalview.org/webstart/jalview.jnlp</a>
60                                 and modify the max-heap-size parameter for the j2se tag in the
61                                 &lt;resources&gt; element. e.g.
62                         <pre>
63 &lt;j2se version="1.7+" initial-heap-size="500M" max-heap-size="1000M"/&gt;
64 </pre> In both cases, you should save your new jnlp file somewhere and
65                         then either point your web browser at the file's url, launch it from
66                         your file browser, or from a terminal window run javaws (located in
67                         your Java installation's bin directory) with the file location as its
68                         argument. The file's url is something like :<br> <pre>
69 file://&lt;full path to file&gt;
70 </pre> If jalview doesn't start up, see <a href="#memsetting">below</a>.
71                         You'll have to edit the above settings in the JNLP file using a text
72                         editor, save it, and try starting Jalview with it once more.
73                         </p></li>
74                 <li><em><font size="3">Install Anywhere version</font></em>
75     <p> You need to change the InstallAnywhere configuration settings for the
76       application. These are found in different places depending upon which operating
77       system you have :
78     <ul>
79       <li><em>Unix/Windows</em>
80         <p> Take a look inside the Jalview program installation directory (this
81           might be in C:\Program Files\Jalview on windows). You should find a
82           file called 'Jalview.lax' in it - make a backup, and then add the following
83           lines to the end of the original file :
84         <pre>
85 lax.nl.java.option.java.heap.size.max=1000m
86 lax.nl.java.option.java.heap.size.initial=500m
87 </pre>
88         Case and (lack of) spaces are important here! Do not add any spaces after
89         the m in each line, and do not put any spaces before 'lax'.<br>
90         Also there MUST be a carriage return after the final line.
91         <p></p>
92       </li>
93       <li><em>Mac OSX</em>
94         <p>The lines you need to change are in the <em>Info.plist</em> file inside
95           the <em>Jalview.app/Contents</em> directory (which is where the installAnywhere
96           installation was made) :
97         <pre>
98 &lt;key&ht;VMOptions&lt;/key&ht;
99 &lt;array&gt;
100 ! &lt;string&gt;-Xms2M&lt;/string&gt;
101 ! &lt;string&gt;-Xmx64M&lt;/string&gt;
102 &lt;/array&gt;
103 </pre>
104         Exchange the above two string tags for :
105         <pre>
106 &lt;string&gt;-Xms500M&lt;/string&gt;
107 &lt;string&gt;-Xmx1000M&lt;/string&gt;
108 </pre>
109         <p></p>
110       </li>
111     </ul>
112   <li><font size="3"><em>In all cases</em></font><br>
113     Save the file and try to start Jalview in the normal way. If it doesn't start,
114     see below... </li>
115 </ul>
116 <font size="3"><em>Jalview doesn't start... What do the memory settings mean ?<a name="memsetting"></a></em></font>
117 <p> The 1000m value corresponds to the maximum number of megabytes of space that
118   java objects can occupy. The 500m is the initial heap size that java will run
119   in - increasing this can speed up memory allocation if you know you will need
120   500 meg of memory to begin with (ie it should speed up loading large alignments).
121 </p>
122 <p> If, after setting the initial and maximum heap size to some large value, you
123   cannot actually start Jalview, then the max and initial sizes are too big for
124   your machine (there seems to be a physical limit related to physical RAM - email
125   the usual address to enlighten us if you know better!). Our experiments found
126   1000m to be the biggest setting that could be used on a 1GB machine. Just try
127   reducing the sizes until Jalview starts up properly! </p>
128 <p>&nbsp;</p>
129 </body>
130 </html>