title: Error when deploying google cloud function - run out of memory?
body: <p>I have used the following deployment for the example code used in the tutorial for a google cloud function. The function should simply print the statements below when a new item is added to my bucket, (which happens every half hour)</p>
  <p>Example code (file is also called hello_gs.py):</p>
  <pre class="lang-python prettyprint-override"><code>def hello_gcs(event, context):
  
      print('Event ID: {}'.format(context.event_id))
      print('Event type: {}'.format(context.event_type))
      print('Bucket: {}'.format(event['bucket']))
      print('File: {}'.format(event['name']))
      print('Metageneration: {}'.format(event['metageneration']))
      print('Created: {}'.format(event['timeCreated']))
      print('Updated: {}'.format(event['updated']))
  </code></pre>
  <p>I deploy it with:</p>
  <pre><code>gcloud functions deploy hello_gcs \
  --trigger-resource bucket1 \
  --trigger-event google.storage.object.finalize
  </code></pre>
  <p>I get the following error in my logs</p>
  <pre><code>insertId: &quot;000000-f7b8ac5b-61f2-4d37-902a-b21ab56372c9&quot;
  labels: {1}
  logName: &quot;projects/project-name-v2/logs/cloudfunctions.googleapis.com%2Fcloud-functions&quot;
  receiveTimestamp: &quot;2021-10-20T11:38:19.093774441Z&quot;
  resource: {2}
  severity: &quot;ERROR&quot;
  textPayload: &quot;Function cannot be initialized. Error: memory limit exceeded.
  &quot;
  timestamp: &quot;2021-10-20T11:38:18.112056018Z&quot;
  </code></pre>
  <p>and yet the function is so simple and small I find this hard to understand?</p>
  <p>Any ideas what I am doing wrong here, and help would be appreciated.</p>