title: What's the reason on "Memory is below 1MB, or missing a M/G at the end of the memory specification?" while I start spark cluster by using start-all.sh
body: <p>I'm building a spark cluster on my Linux operating system. but when I started it by using <code>./sbin/start-all.sh</code>, The following error occurred from the slave node. How can I solve it?</p>
  
  <p>I checked the environment configuration <code>cat /etc/profile</code> and reloaded it <code>source /etc/profile</code>.But I found nothing wrong.</p>
  
  <p>The following is the content of spark-env.sh</p>
  
  <pre class="lang-sh prettyprint-override"><code>export JAVA_HOME=/root/apps/jdk1.8.0_60
  export SCALA_HOME=/root/apps/scala
  export SPARK_MASTER_HOST=hdp-01
  export SPARK_WORKER_MEMORY=512
  export SPARK_WORKER_CORES=2
  export SPARK_WORKER_INSTANCES=1
  export SPARK_MASTER_PORT=7077
  </code></pre>
  
  <p>I want to start a spark cluster with <code>./sbin/start-all.sh</code>,but the actual result is the following:</p>
  
  <pre class="lang-sh prettyprint-override"><code>Using Spark's default log4j profile: org/apache/spark/log4j-defaults.properties
  Exception in thread "main" java.lang.IllegalStateException: Memory is below 1MB, or missing an M/G at the end of the memory specification?
          at org.apache.spark.deploy.worker.WorkerArguments.checkWorkerMemory(WorkerArguments.scala:181)
          at org.apache.spark.deploy.worker.WorkerArguments.&lt;init&gt;(WorkerArguments.scala:66)
          at org.apache.spark.deploy.worker.Worker$.main(Worker.scala:742)
          at org.apache.spark.deploy.worker.Worker.main(Worker.scala)
  </code></pre>