tacitknowledge / aem-cookbook

Chef cookbook for Adobe AEM
79 stars 64 forks source link

Update jar_installer.rb #7

Closed ericachelis closed 9 years ago

ericachelis commented 9 years ago

The IO.read method reads the entire JAR file into RAM. In our environment the jar file is roughly 900MB. This was causing Out of Memory exceptions on our machines.

This proposed change will leverage the remote_file resource and the source attribute. The file is still read from the local cache directory. The file is buffered much more effectively when taking this approach.

I also propose updating the action to only create the file if it is missing.

This change reduced the memory consumption of this resource by more than an order of magnitude. This change also reduced the execution duration for this resource by roughly 10 seconds in our environment.

Please let me know if you have any questions.

pdunnavant commented 9 years ago

Awesome! Thanks! I'll take a look at this a little later today.

pdunnavant commented 9 years ago

:+1: I ran all the tests, everything looks great. Thanks again for your contribution!