title: How to use JVM parameters for web application running on tomcat, on linux machine
body: <p>I want to use a different garbage collector than the default Parallel GC for my web application when deployed on my production server, which will be on linux.</p>
  
  <p>Say for an example i want to use Concurrent Mark Sweep GC for the application.</p>
  
  <p>Now i have read that we can use this by adding <code>-XX:+UseConcMarkSweepGC</code> and various other JVM parameters to fine tune it.</p>
  
  <p>So while packaging my war using maven i include this extra JVM parameters.
  example:  </p>
  
  <pre><code>mvn clean package -Dgwt.extraJvmArgs="-Xms2048m -Xmx2048m -XX:PermSize=512M -XX:MaxPermSize=512M -XX:+UseConcMarkSweepGC" 
  </code></pre>
  
  <p>The war is packaged, i deploy it on my tomcat server which is running on linux environment.</p>
  
  <p><b>Note i package this war on a windows machine then deploy the war in linux machine using putty and winscp</b></p>
  
  <p>What i don't understand is how will this ensure that CMS GC is running? I mean shouldn't i include these changes where my application is running?</p>
  
  <p>Or including these JVM parameters while packaging the was is good enough.</p>
  
  <p>Same goes if i want to include various other JVM parameters, including while packaging the war is good to go or we need to include these some where else too?</p>
  
  <p>Please explain.</p>