title: Give more memory to my jar file
body: <p>I have a multithreaded crawler. In this program, if I load a lot of seeds, I get an error. I saw the <code>java.lang.OutOfMemoryError</code> and thought maybe the memory is not enough. I tried running the <code>crawler.jar</code> file with these arguments: <code>java -Xms512m -Xmx3G -jar crawler.jar</code> but so far, no luck.</p>
  
  <p>This is the StackTrace of the program:</p>
  
  <pre><code>Exception in thread "main" java.lang.reflect.InvocationTargetException
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
  Caused by: java.lang.OutOfMemoryError: unable to create new native thread
          at java.lang.Thread.start0(Native Method)
          at java.lang.Thread.start(Thread.java:597)
          at com.sleepycat.je.utilint.DaemonThread.runOrPause(DaemonThread.java:99)
          at com.sleepycat.je.dbi.EnvironmentImpl.runOrPauseDaemons(EnvironmentImpl.java:772)
          at com.sleepycat.je.dbi.EnvironmentImpl.envConfigUpdate(EnvironmentImpl.java:717)
          at com.sleepycat.je.dbi.EnvironmentImpl.finishInit(EnvironmentImpl.java:579)
          at com.sleepycat.je.dbi.DbEnvPool.getEnvironment(DbEnvPool.java:204)
          at com.sleepycat.je.Environment.makeEnvironmentImpl(Environment.java:230)
          at com.sleepycat.je.Environment.&lt;init&gt;(Environment.java:212)
          at com.sleepycat.je.Environment.&lt;init&gt;(Environment.java:166)
          ...
  </code></pre>
  
  <p>Is this related to memory as I suspected? Does adding the <code>-Xms512m -Xmx3G</code> work when I'm running the jar file using <code>java -jar</code>?</p>
  
  <p>I ran task manager (I'm running on Windows Server) but after running the app, the memory doesn't go that far higher! Am I wrong?</p>