title: Amazon Lambda runs out of memory when creating an image thumbnail
body: <p>So my setup is as follows: A S3 bucket that stores images and another S3 bucket that stores the thumbnail of the images. The goal is whenever a new image is uploaded to the first bucket, the Lambda function is triggered and creates a thumbnail and stores it in the second bucket. </p>
  
  <p>I have followed the documentation that is provided on the Amazon AWS website, and I've tried both Java and NodeJS for the Lambda function. Also, the memory I have allocated to Lambda is the maximum possible (1.5 GB). </p>
  
  <p>The issue that I'm facing is that this procedure works perfectly when the images are small in size but when the image size gets bigger (I have issues with an image that is about 40 MB - Eventually I want the system to work with images that could be upto 1500 MB in size), it runs out of memory.</p>
  
  <p>In Java, I run out of Java heap space. </p>
  
  <p>In NodeJS, the error I get is "Stream yields empty buffer. Memory Size: 1536 MB Max Memory Used: 1536 MB"</p>
  
  <p>Is there any way to solve this issue?</p>