jalview memory monitor instructions added
[jalview.git] / help / html / memory.html
1 <html>
2 <head><title>Memory Settings</title></head>
3 <body>
4 <h2>
5   <center>
6     <strong>Memory Usage Settings for Jalview</strong>
7   </center>
8 </h2>
9 <p>Jalview sometimes runs out of memory. This is because of the way that Java
10   runs on a computer - what is actually run is a program called a virtual machine
11   (the JVM) which executes the java instructions. The JVM has limits on the memory
12   that can be allocated to the java program - and you might need to increase them
13   if you are working with particularly large datasets.<br>
14   If Jalview has not explicitly told you that it has run out of memory, then a
15   common sign is that a function that normally works seems to have no effect when
16   working with a larger set of sequences (this might include open dialog boxes
17   for saving PNG files, or when interpreting the result of a web service calculation).</p>
18   <p><em>Jalview Memory Usage Monitor</em>: If you are concerned about memory, or think that things might be behaving 
19   strangely because of a shortage of memory, then you can check this by enabling the 
20   memory usage monitor. This is done by selecting the <strong>Tools&#8594;Show Memory Usage</strong>
21   option. Once enabled, the memory usage monitor displays the currently 
22   available memory, the total memory, and the percentage free at the 
23   bottom left hand side of the Jalview Desktop window's background.</p>
24 <p><em>Increasing the memory available to Jalview</em><br>
25 The way you increase the memory settings for the JVM depends on which installation
26   of Jalview you use:</p>
27 <ul>
28   <li><em><font size="3">Web Start Version</font></em>
29     <p>JavaWS sets the JVM parameters through special tags in the JNLP file. You'll
30       need to <a href="jalviewjnlp.html">make your own jnlp file</a> and add the following parameter into the
31       &lt;resources&gt; element.
32     <pre>
33 &lt;j2se version="1.4+" initial-heap-size="500M" max-heap-size="1000M"/&gt;
34 </pre>
35     Save the jnlp file somewhere and then - if you start Jalview through your
36     web browser, point your browser at the file's url, othewise simply run javaws
37     with the file location as its argument. The file's url is something like :<br>
38     <pre>
39 file://&lt;full path to file&gt;
40 </pre>
41     If jalview doesn't start up, see <a href="#memsetting">below</a>. You'll have
42     to edit the above settings in the JNLP file using a text editor, save it,
43     and try starting Jalview with it once more.
44     <p></li>
45   <li><em><font size="3">Install Anywhere version</font></em>
46     <p> You need to change the InstallAnywhere configuration settings for the
47       application. These are found in different places depending upon which operating
48       system you have :
49     <ul>
50       <li><em>Unix/Windows</em>
51         <p> Take a look inside the Jalview program installation directory (this
52           might be in C:\Program Files\Jalview on windows). You should find a
53           file called 'Jalview.lax' in it - make a backup, and then add the following
54           lines to the end of the original file :
55         <pre>
56 lax.nl.java.option.java.heap.size.max=1000m
57 lax.nl.java.option.java.heap.size.initial=500m
58 </pre>
59         Case and (lack of) spaces are important here! Do not add any spaces after
60         the m in each line, and do not put any spaces before 'lax'.<br>
61         Also there MUST be a carriage return after the final line.
62         <p></p>
63       </li>
64       <li><em>Mac OSX</em>
65         <p>The lines you need to change are in the <em>Info.plist</em> file inside
66           the <em>Jalview.app/Contents</em> directory (which is where the installAnywhere
67           installation was made) :
68         <pre>
69 &lt;key&ht;VMOptions&lt;/key&ht;
70 &lt;array&gt;
71 ! &lt;string&gt;-Xms2M&lt;/string&gt;
72 ! &lt;string&gt;-Xmx64M&lt;/string&gt;
73 &lt;/array&gt;
74 </pre>
75         Exchange the above two string tags for :
76         <pre>
77 &lt;string&gt;-Xms500M&lt;/string&gt;
78 &lt;string&gt;-Xmx1000M&lt;/string&gt;
79 </pre>
80         <p></p>
81       </li>
82     </ul>
83   <li><font size="3"><em>In all cases</em></font><br>
84     Save the file and try to start Jalview in the normal way. If it doesn't start,
85     see below... </li>
86 </ul>
87 <font size="3"><em>Jalview doesn't start... What do the memory settings mean ?<a name="memsetting"></a></em></font>
88 <p> The 1000m value corresponds to the maximum number of megabytes of space that
89   java objects can occupy. The 500m is the initial heap size that java will run
90   in - increasing this can speed up memory allocation if you know you will need
91   500 meg of memory to begin with (ie it should speed up loading large alignments).
92 </p>
93 <p> If, after setting the initial and maximum heap size to some large value, you
94   cannot actually start Jalview, then the max and initial sizes are too big for
95   your machine (there seems to be a physical limit related to physical RAM - email
96   the usual address to enlighten us if you know better!). Our experiments found
97   1000m to be the biggest setting that could be used on a 1GB machine. Just try
98   reducing the sizes until Jalview starts up properly! </p>
99 <p>&nbsp;</p>
100 </body>
101 </html>