tacitknowledge/aem-cookbook — pull request #7 by ericachelis (2014-09-16 20:20:38+00:00)
Title: Update jar_installer.rb

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.