Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Memory Limit Hit

Memory Limit Hit following rubyrailstutorial.org

Hi,

I am following the tutorial on Ruby Rails Tutorial and I am using the Cloud9 IDE however I keep getting a "Memory Limit Hit" when running through the tutorial. I am using the free tier which comes with 512MB Ram which is constantly in the red zone.

I have tried killing some processes, but as soon as I start back on the tutorial I keep getting the error.

Thanks

Michael

like image 323
mickeysox Avatar asked Jan 21 '15 10:01

mickeysox


People also ask

What happens when you hit RAM limit?

Originally Answered: How does a computer work if it hits the ram limit? When you run out of physical RAM, your computer will start to use “virtual RAM”. This means it will start using up some temporary space in your primary storage drive (HDD/SSD) since it doesn't have enough RAM.

What happens when RAM hits 100%?

If the memory usage is close to 100%, this can slow things down a lot. This is because the computer will then try to use your hard disk as a temporary memory store, called swap memory. Hard disks are much slower than the system memory. You can try to free up some system memory by closing some programs.

What is a memory limit?

The memory limit setting fixes a memory size for executing a script. It prevents ineffectively coded scripts on the server that designate superfluous space, thus sparing server memory during large-scale utilization of the application.


1 Answers

Short answer: Spring has a bug that causes it to use up memory by spawning too many processes.

From your c9 shell, run

pkill -9 -f spring 

and restart your rails server.

Longer answer: He describes a lot about it in Chapter 3 of the tutorial. Box 3.4 on this page https://www.railstutorial.org/book/static_pages covers it nicely.

Incidentally, I found that I couldn't simply restart my c9 session...it's really good at persisting the state of your virtual server ... including all of the extra Spring processes.

like image 133
Greg Lyon Avatar answered Oct 25 '22 08:10

Greg Lyon