title: JVM options not taken into consideration, spark-submit of java program
body: <p>Using spark-submit I'm launching a java program. However I'm setting java arguments for the JVM that are not taken into account. I'm trying to specify the max/min heap free ratio. </p>
  
  <p>However, even though the arguments are present (based on visualvm), the memory graph shows that they don't affect the running program.</p>
  
  <p>Here is the command I'm launching:</p>
  
  <blockquote>
    <p>"/usr/jdk1.8.0_131/bin/java" "-Xmx4096M" "-Dspark.driver.extraJavaOptions=-XX:MinHeapFreeRatio=30 -XX:MaxHeapFreeRatio=30 -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005" "-Dspark.executor.extraJavaOptions=-XX:MinHeapFreeRatio=30 -XX:MaxHeapFreeRatio=30" "-XX:MinHeapFreeRatio=30" "-XX:MaxHeapFreeRatio=30"</p>
  </blockquote>
  
  <p>As you can see, I've tried setting the arguments on the driver, executor and java command.</p>
  
  <p>Here is the arguments from visualvm:
  <a href="https://i.stack.imgur.com/h8DF5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h8DF5.png" alt="enter image description here"></a></p>
  
  <p>and here is the graph:<a href="https://i.stack.imgur.com/AP6pc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AP6pc.png" alt="enter image description here"></a></p>
  
  <p>To be clear, what I'm trying to improve is the "unused" heap size.</p>
  
  <p>When starting the program with these arguments (outside of spark), it behaves correctly.</p>