Posts

Showing posts with the label Memory Management

Cloud Functions For Firebase Killed Due To Memory Limit Exceeded

Answer : You can set this from within your Cloud Function file on Firebase. const runtimeOpts = { timeoutSeconds: 300, memory: '1GB' } exports.myStorageFunction = functions .runWith(runtimeOpts) .storage .object() .onFinalize((object) = > { // do some complicated things that take a lot of memory and time }); Take from the docs here: https://firebase.google.com/docs/functions/manage-functions#set_timeout_and_memory_allocation Don't forget to then run firebase deploy from your terminal. I was lost in the UI, couldn't find any option to change the memory, but finally found it: Go to the Google Cloud Platform Console (not the Firebase console) Select Cloud Functions in the menu Now you see your firebase function in here if it's correct. Otherwise check if you selected the right project. Ignore all checkboxes, buttons and menu items, just click on the name of the function . Click on edit (top menu) and only change the allocated me...