Sam Kong
Sam Kong

Reputation: 5810

PG::Error: ERROR: out of memory on Heroku

I deployed an application on Heroku. I'm using the free service.

Quite frequently, I get the following error.

PG::Error: ERROR:  out of memory

If I refresh the browser, it's ok. But then, it happens again randomly.

Why does this happen?

Thanks.

Sam Kong

Upvotes: 10

Views: 8192

Answers (3)

Lomefin
Lomefin

Reputation: 1252

If you are not in a free tier, its maybe because you are using too much memory connecting to PG.

Consider an app running on several dynos, with several processes, each with lots of threads, maybe you are filling up the pool.

Also, as it appears in Heroku's Help Center maybe you are caching too many statements that wont be used.

Upvotes: 0

Menan Vadivel
Menan Vadivel

Reputation: 106

heroku restart simply helped me though

Upvotes: 5

catsby
catsby

Reputation: 11342

If you experience these when running queries, your queries are complicated or inefficient. The free tier has no cache, so you're already out there.

If you're getting these errors otherwise, open a support ticket at https://help.heroku.com

Upvotes: 10

Related Questions