title: Memory allocation for Java Webstart Application
body: <p>I'm using a Java webstart application called <a href="http://blast2go.bioinfo.cipf.es/start_blast2go" rel="nofollow">BLAST2GO</a> I'm running into problems with memory allocation. It needs to load a large data set into memory, so I've been trying to allocate 3-6GB to this application. However, no matter what I set as the max heap size, it always uses 455MB (as indicated by the message bar: 'Memory usage: xxMB of 455MB'). I've tried setting it to very reasonable levels (1024 MB), but still only 455MB are allocation.</p>
  
  <p>Any ideas?</p>
  
  <p>BTW, I'm using Ubuntu 10.04 32-bit with 24GB memory, 8 procs.</p>
  
  <p><strong>Update</strong>: Here is the JNLP they provide. I get the same result when I edit the values of the <code>initial-heap-size</code> and <code>max-heap-size</code> attributes.</p>
  
  <pre><code>&lt;jnlp spec="1.0+" codebase="http://bioinfo.cipf.es/blast2go/webstart" href="http://bioinfo.cipf.es/blast2go/webstart/makeJnlp.php?mem=3072"&gt;
  &lt;information&gt;
  &lt;title&gt;Blast2GO 3072M&lt;/title&gt;
  &lt;vendor&gt;CIPF - UPV - IVIA&lt;/vendor&gt;
  &lt;homepage href="http://www.blast2go.org"/&gt;
  &lt;description&gt;Blast2GO 3072M&lt;/description&gt;
  &lt;description kind="short"&gt;Blast2GO 3072M&lt;/description&gt;
  &lt;icon href="splash.gif"/&gt;
  &lt;offline-allowed/&gt;
  &lt;/information&gt;
  &lt;security&gt;
  &lt;all-permissions/&gt;
  &lt;/security&gt;
  &lt;resources&gt;
  &lt;j2se version="1.5+" initial-heap-size="64m" max-heap-size="3072M"/&gt;
  &lt;jar href="ext/blast2go.jar"/&gt;
  &lt;jar href="ext/biojava-1.3.1.jar"/&gt;
  &lt;jar href="ext/jfreechart-1.0.10.jar"/&gt;
  &lt;jar href="ext/mysql-connector-java-3.0.11-stable-bin.jar"/&gt;
  &lt;jar href="ext/zvtm.jar"/&gt;
  &lt;jar href="ext/jakarta-regexp-1.4.jar"/&gt;
  &lt;jar href="ext/jcommon-1.0.13.jar"/&gt;
  &lt;jar href="ext/Simpat1.1.jar"/&gt;
  &lt;jar href="ext/iText-2.1.1.jar"/&gt;
  &lt;jar href="ext/jdom/activation.jar"/&gt;
  &lt;jar href="ext/jdom/ant.jar"/&gt;
  &lt;jar href="ext/jdom/jaxen-core.jar"/&gt;
  &lt;jar href="ext/jdom/jaxen-jdom.jar"/&gt;
  &lt;jar href="ext/jdom/jdom.jar"/&gt;
  &lt;jar href="ext/jdom/mail.jar"/&gt;
  &lt;jar href="ext/jdom/saxpath.jar"/&gt;
  &lt;jar href="ext/jdom/xalan.jar"/&gt;
  &lt;jar href="ext/jdom/xerces.jar"/&gt;
  &lt;jar href="ext/jdom/xml-apis.jar"/&gt;
  &lt;jar href="ext/interpro/commons-cli-1.0.jar"/&gt;
  &lt;jar href="ext/interpro/commons-cli.jar"/&gt;
  &lt;jar href="ext/interpro/freefluo.jar"/&gt;
  &lt;jar href="ext/interpro/servlet.jar"/&gt;
  &lt;jar href="ext/interpro/WSInterProScan.jar"/&gt;
  &lt;jar href="ext/axis_1_4/axis-ant.jar"/&gt;
  &lt;jar href="ext/axis_1_4/axis.jar"/&gt;
  &lt;jar href="ext/axis_1_4/commons-discovery-0.2.jar"/&gt;
  &lt;jar href="ext/axis_1_4/commons-logging-1.0.4.jar"/&gt;
  &lt;jar href="ext/axis_1_4/jaxrpc.jar"/&gt;
  &lt;jar href="ext/axis_1_4/keggapi.jar"/&gt;
  &lt;jar href="ext/axis_1_4/log4j-1.2.8.jar"/&gt;
  &lt;jar href="ext/axis_1_4/saaj.jar"/&gt;
  &lt;jar href="ext/axis_1_4/wsdl4j-1.5.1.jar"/&gt;
  &lt;jar href="ext/axis2/activation-1.1.jar"/&gt;
  &lt;jar href="ext/axis2/annogen-0.1.0.jar"/&gt;
  &lt;jar href="ext/axis2/axiom-api-1.2.2.jar"/&gt;
  &lt;jar href="ext/axis2/axiom-dom-1.2.2.jar"/&gt;
  &lt;jar href="ext/axis2/axiom-impl-1.2.2.jar"/&gt;
  &lt;jar href="ext/axis2/axis2-adb-1.1.1.jar"/&gt;
  &lt;jar href="ext/axis2/axis2-adb-codegen-1.1.1.jar"/&gt;
  &lt;jar href="ext/axis2/axis2-codegen-1.1.1.jar"/&gt;
  &lt;jar href="ext/axis2/axis2-java2wsdl-1.1.1.jar"/&gt;
  &lt;jar href="ext/axis2/axis2-jaxbri-1.1.1.jar"/&gt;
  &lt;jar href="ext/axis2/axis2-jibx-1.1.1.jar"/&gt;
  &lt;jar href="ext/axis2/axis2-kernel-1.1.1.jar"/&gt;
  &lt;jar href="ext/axis2/axis2-saaj-1.1.1.jar"/&gt;
  &lt;jar href="ext/axis2/axis2-soapmonitor-1.1.1.jar"/&gt;
  &lt;jar href="ext/axis2/axis2-spring-1.1.1.jar"/&gt;
  &lt;jar href="ext/axis2/axis2-tools-1.1.1.jar"/&gt;
  &lt;jar href="ext/axis2/axis2-xmlbeans-1.1.1.jar"/&gt;
  &lt;jar href="ext/axis2/backport-util-concurrent-2.2.jar"/&gt;
  &lt;jar href="ext/axis2/commons-codec-1.3.jar"/&gt;
  &lt;jar href="ext/axis2/commons-fileupload-1.1.1.jar"/&gt;
  &lt;jar href="ext/axis2/commons-httpclient-3.0.1.jar"/&gt;
  &lt;jar href="ext/axis2/commons-io-1.2.jar"/&gt;
  &lt;jar href="ext/axis2/commons-logging-1.1.jar"/&gt;
  &lt;jar href="ext/axis2/geronimo-spec-jms-1.1-rc4.jar"/&gt;
  &lt;jar href="ext/axis2/jakarta-httpcore-4.0-alpha2.jar"/&gt;
  &lt;jar href="ext/axis2/jaxb-api-2.0.2.jar"/&gt;
  &lt;jar href="ext/axis2/jaxb-impl-2.0.2.jar"/&gt;
  &lt;jar href="ext/axis2/jaxb-xjc-2.0.2.jar"/&gt;
  &lt;jar href="ext/axis2/jaxen-1.1-beta-10.jar"/&gt;
  &lt;jar href="ext/axis2/jibx-bind-1.1.3.jar"/&gt;
  &lt;jar href="ext/axis2/jibx-run-1.1.3.jar"/&gt;
  &lt;jar href="ext/axis2/mail-1.4.jar"/&gt;
  &lt;jar href="ext/axis2/neethi-2.0.jar"/&gt;
  &lt;jar href="ext/axis2/servletapi-2.3.jar"/&gt;
  &lt;jar href="ext/axis2/stax-api-1.0.1.jar"/&gt;
  &lt;jar href="ext/axis2/woden-1.0.0M6.jar"/&gt;
  &lt;jar href="ext/axis2/wsdl4j-1.6.2.jar"/&gt;
  &lt;jar href="ext/axis2/wstx-asl-3.2.0.jar"/&gt;
  &lt;jar href="ext/axis2/xalan-2.7.0.jar"/&gt;
  &lt;jar href="ext/axis2/xbean-2.2.0.jar"/&gt;
  &lt;jar href="ext/axis2/xercesImpl-2.8.1.jar"/&gt;
  &lt;jar href="ext/axis2/xml-apis-1.3.03.jar"/&gt;
  &lt;jar href="ext/axis2/XmlSchema-1.2.jar"/&gt;
  &lt;jar href="ext/batik/batik-anim.jar"/&gt;
  &lt;jar href="ext/batik/batik-awt-util.jar"/&gt;
  &lt;jar href="ext/batik/batik-bridge.jar"/&gt;
  &lt;jar href="ext/batik/batik-codec.jar"/&gt;
  &lt;jar href="ext/batik/batik-css.jar"/&gt;
  &lt;jar href="ext/batik/batik-dom.jar"/&gt;
  &lt;jar href="ext/batik/batik-extension.jar"/&gt;
  &lt;jar href="ext/batik/batik-ext.jar"/&gt;
  &lt;jar href="ext/batik/batik-gui-util.jar"/&gt;
  &lt;jar href="ext/batik/batik-gvt.jar"/&gt;
  &lt;jar href="ext/batik/batik-parser.jar"/&gt;
  &lt;jar href="ext/batik/batik-script.jar"/&gt;
  &lt;jar href="ext/batik/batik-svg-dom.jar"/&gt;
  &lt;jar href="ext/batik/batik-svggen.jar"/&gt;
  &lt;jar href="ext/batik/batik-swing.jar"/&gt;
  &lt;jar href="ext/batik/batik-transcoder.jar"/&gt;
  &lt;jar href="ext/batik/batik-util.jar"/&gt;
  &lt;jar href="ext/batik/batik-xml.jar"/&gt;
  &lt;jar href="ext/batik/js.jar"/&gt;
  &lt;jar href="ext/batik/pdf-transcoder.jar"/&gt;
  &lt;jar href="ext/batik/xalan-2.6.0.jar"/&gt;
  &lt;jar href="ext/batik/xerces_2_5_0.jar"/&gt;
  &lt;jar href="ext/batik/xml-apis-ext.jar"/&gt;
  &lt;jar href="ext/batik/xml-apis.jar"/&gt;
  &lt;/resources&gt;
  &lt;application-desc main-class="es.blast2go.prog.MainProg"/&gt;
  &lt;/jnlp&gt;
  </code></pre>
  
  <p><strong>Update</strong>: I tried changing the <code>href</code> attribute in the root <code>jnlp</code> tag and I got a very strange message on the terminal. I wonder if Java is re-downloading the JNLP from this URL each time and ignoring my attempts to edit the JNLP. Is there a way I can prevent this?</p>
  
  <pre><code>&gt; javaws blast2go3GB.jnlp 
  Error occurred during initialization of VM
  CCoouulldd  nnoott  crreesaetrev et heen oJuagvha  svpiarcteu aflo rm aocbhjiencet. 
  heap
  </code></pre>
  
  <p><strong>Final Update</strong>: Turns out this was a problem with the Java Version. I got the expected behavior when I downloaded and used Sun Java.</p>