laurilehmijoki / s3_website

Manage an S3 website: sync, deliver via CloudFront, benefit from advanced S3 website features.
Other
2.24k stars 187 forks source link

Out of memory error #309

Open larrykollar opened 6 years ago

larrykollar commented 6 years ago

I was able to update in mid-March. Now I'm getting out of memory errors:

larry$ s3_website push
[info] Downloading https://github.com/laurilehmijoki/s3_website/releases/download/v3.4.0/s3_website.jar into /var/folders/fq/p1v8pqfd7lx87mxqpvmxltxm0000gq/T//s3_website-3.4.0.jar
[info] Deploying /Users/larry/Documents/blog/_site/* to www.larrykollar.com
Exception in thread "pool-1-thread-9" java.lang.OutOfMemoryError: Java heap space
    at scala.collection.mutable.ListBuffer.$plus$eq(ListBuffer.scala:174)
    at scala.collection.mutable.ListBuffer.$plus$eq(ListBuffer.scala:45)
    at scala.collection.generic.Growable$class.loop$1(Growable.scala:53)
    at scala.collection.generic.Growable$class.$plus$plus$eq(Growable.scala:57)
    at scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:183)
    at scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:45)
    at scala.collection.TraversableLike$class.$plus$plus(TraversableLike.scala:157)
    at scala.collection.immutable.List.$plus$plus(List.scala:196)
    at s3.website.S3$$anonfun$resolveS3Files$2.apply(S3.scala:140)
    at s3.website.S3$$anonfun$resolveS3Files$2.apply(S3.scala:132)
    at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:251)
    at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:249)
    at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

This is happening on MacOSX 10.13.4. I'm not sure if a system update or a Java update is to blame here.

larry$ java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

Any thoughts? Thanks.

larrykollar commented 6 years ago

Found a workaround.

_JAVA_OPTIONS=-Xmx8g s3_website push

Allocate a whipping 8GB, and it works. (6GB didn't work, I haven't tried with 7 yet.)

larrykollar commented 6 years ago

SOLVED. Turn off logging and delete the logs/ folder. Even if you set ignore_on_server: logs/*, it still spiders the folder (which you can verify using the --verbose option). When you get 700K logs in there, things go to #3|| in a hand basket pretty quick. It would be nice if ignore_on_server actually did ignore things, but whatever.

Leaving this open in case someone else runs across it.