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

Exception in thread "pool-1-thread-1" java.lang.OutOfMemoryError: Java heap space #155

Closed amalagaura closed 9 years ago

amalagaura commented 9 years ago

I have a pretty small website so I am not sure why I am getting the Java heap space error.

I tried setting Xmx with JAVA_OPTS but no luck

export JAVA_OPTS=-Xmx4G

Any help on how to increase the Xmx ?

amalagaura commented 9 years ago

I manually edited it by adding the Xmx it to the run_s3_website_jar java run system method and it worked. Do you want to create a command line option for this or just set a default to avoid these heap space errors?

laurilehmijoki commented 9 years ago

Let's set a default value for the Xmx setting. Can you send a pull request?

amalagaura commented 9 years ago

I don't understand my issue. I was trying to reproduce it, but I set it to -Xmx128M and it pushed successfully. I don't understand why I had the issue, I have 60 pages and there was 1 update yesterday which would not work. Today they all pushed with -Xmx128M but a default should be higher anyway.

Should we leave it until someone else has an issue?

laurilehmijoki commented 9 years ago

s3_website uses native threads, so the memory consumption is not deterministic. This mat explain what you are experiencing.

We could run s3_website through a memory profiler. This would give us a rough picture of the memory usage characteristics. Based on this picture we could then define the maximum heap size.

The max heap size should probably be higher than what most JVMs use, because you are experiencing the problem every now and then.

laurilehmijoki commented 9 years ago

Closing as inactive. Please reopen if needed.