problem using Python to increase virtual memory for my java application
<p>I have created a java application in Eclipse which when I increase the VM arguments to -Xmx1024m runs fine. When I try to run the application via the command promt using the following path:</p>

<p>c:\python27\python c:\jars2run\run.py c:\jars2run\myown\ClassTree.jar LiveSimulator2/Live_PairsEngine3 java -Xmx1024m</p>

<p>I get the following error message:</p>

<pre><code>Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.nio.CharBuffer.wrap(Unknown Source)
at java.nio.CharBuffer.wrap(Unknown Source)
at java.lang.StringCoding$StringDecoder.dec… Source)
at java.lang.StringCoding.decode(Unknown Source)
at java.lang.String.&lt;init&gt;(Unknown Source)
at java.lang.String.&lt;init&gt;(Unknown Source)
at com.mysql.jdbc.ResultSet.getStringIntern…
at com.mysql.jdbc.ResultSet.getString(Resul…
at com.mysql.jdbc.ResultSet.getString(Resul…
at LiveSimulator2.Timeseries2.&lt;init&gt;(Timese…
at LiveSimulator2.Live_PairsEngine3.main(Li…
</code></pre>

<p>I have found out that I need to add the heap memory requirement in the python script but cannot figure out where in the scipt I have to put the 'java -Xmx1024m' or what ever is needed and therefore the java application still falls over due to lack of memory.  </p>

<p>See below for the python script, at the moment the python script just copies the external jars need to run my java application. </p>

<pre><code>import sys
import os

classfile=sys.argv[2];
jar=sys.argv[1];
cp='%s' % jar
FILES=os.listdir('c:/jars2run/3rdparty');
os.chdir('c:/jars2run/3rdparty');
for i in FILES:
    if (i.endswith('jar')):
        cp='%s;%s' % (cp, i)

cmd='java -classpath "%s" %s' % (cp, classfile)
print('%s' % cmd)
os.system(cmd)
</code></pre>

<p>Could someone let me know where the memory increase needs to should go please.</p>

<p>Very grateful for any assistance.</p>
