openzipkin-attic / docker-zipkin

Docker images for OpenZipkin
Apache License 2.0
688 stars 329 forks source link

java.lang.IllegalArgumentException: System memory #115

Closed codefromthecrypt closed 8 years ago

codefromthecrypt commented 8 years ago

his was reported by @rogeralsing and @mikewrighton. We should add how to set heap size with JAVA_OPTS to the docker-compose file

11:00:01.856 [main] ERROR org.apache.spark.SparkContext - Error initializing SparkContext.
dependencies    | java.lang.IllegalArgumentException: System memory 466092032 must be at least 4.718592E8. Please use a larger heap size.
dependencies    |       at org.apache.spark.memory.UnifiedMemoryManager$.getMaxMemory(UnifiedMemoryManager.scala:198)
dependencies    |       at org.apache.spark.memory.UnifiedMemoryManager$.apply(UnifiedMemoryManager.scala:180)
dependencies    |       at org.apache.spark.SparkEnv$.create(SparkEnv.scala:354)
dependencies    |       at org.apache.spark.SparkEnv$.createDriverEnv(SparkEnv.scala:193)
dependencies    |       at org.apache.spark.SparkContext.createSparkEnv(SparkContext.scala:288)
dependencies    |       at org.apache.spark.SparkContext.<init>(SparkContext.scala:457)
dependencies    |       at org.apache.spark.api.java.JavaSparkContext.<init>(JavaSparkContext.scala:59)
dependencies    |       at zipkin.dependencies.mysql.MySQLDependenciesJob.run(MySQLDependenciesJob.java:174)
dependencies    |       at zipkin.dependencies.ZipkinDependenciesJob.main(ZipkinDependenciesJob.java:37)
dependencies    | Exception in thread "main" java.lang.IllegalArgumentException: System memory 466092032 must be at least 4.718592E8. Please use a larger heap size.
dependencies    |       at org.apache.spark.memory.UnifiedMemoryManager$.getMaxMemory(UnifiedMemoryManager.scala:198)
dependencies    |       at org.apache.spark.memory.UnifiedMemoryManager$.apply(UnifiedMemoryManager.scala:180)
dependencies    |       at org.apache.spark.SparkEnv$.create(SparkEnv.scala:354)
dependencies    |       at org.apache.spark.SparkEnv$.createDriverEnv(SparkEnv.scala:193)
dependencies    |       at org.apache.spark.SparkContext.createSparkEnv(SparkContext.scala:288)
dependencies    |       at org.apache.spark.SparkContext.<init>(SparkContext.scala:457)
dependencies    |       at org.apache.spark.api.java.JavaSparkContext.<init>(JavaSparkContext.scala:59)
dependencies    |       at zipkin.dependencies.mysql.MySQLDependenciesJob.run(MySQLDependenciesJob.java:174)
dependencies    |       at zipkin.dependencies.ZipkinDependenciesJob.main(ZipkinDependenciesJob.java:37)
dependencies    | run-parts: /etc/periodic/hourly/zipkin-dependencies-today: exit status 1
codefromthecrypt commented 8 years ago

You'll want to set something like this, which for example allocates 1GB. Not sure how much you will need. The verbose:gc is optional JAVA_OPTS=-verbose:gc -Xms1G -Xmx1G

http://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html#BABDJJFI