RStudio Cloud crashes when calculating GAMM

I am trying to run a GAMM on RStudio cloud (subscription plan:free). But the application always crashes by ending the project and restarting it. Do I do something wrong?

Most likely you are running out of RAM memory, the free plan only has 1GB of RAM.