# 25GB of "cannot allocate memory" logs

**URL:** https://meta.discourse.org/t/25gb-of-cannot-allocate-memory-logs/33533
**Category:** Support
**Created:** [9월 21, 2015, 6:24오후 UTC](https://meta.discourse.org/t/25gb-of-cannot-allocate-memory-logs/33533 "2015-09-21T18:24:32Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![michaelgiesler](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michaelgiesler/32/46374_2.png) [@michaelgiesler](https://meta.discourse.org/u/michaelgiesler)
#### Post date: [9월 21, 2015, 6:24오후 UTC](https://meta.discourse.org/t/25gb-of-cannot-allocate-memory-logs/33533/1 "2015-09-21T18:24:32Z")

</div>

I installed Discourse a few days ago following the installation guide on DigitalOcean with 1GB RAM with a Swap file.

Now I get lots of log messages like

```
> E, [2015-09-21T07:56:41.518010 #21097] ERROR -- : master loop error: Cannot allocate memory - ps -eo rss,args | grep sidekiq | grep -v grep | awk '{print $1}' (Errno::ENOMEM)
> E, [2015-09-21T07:56:41.518119 #21097] ERROR -- : /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.10/lib/active_support/core_ext/kernel/agnostics.rb:7:in ``'
> E, [2015-09-21T07:56:41.518162 #21097] ERROR -- : /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.10/lib/active_support/core_ext/kernel/agnostics.rb:7:in ``'
> E, [2015-09-21T07:56:41.518198 #21097] ERROR -- : config/unicorn.conf.rb:84:in `max_rss'
> E, [2015-09-21T07:56:41.518222 #21097] ERROR -- : config/unicorn.conf.rb:99:in `out_of_memory?'
> E, [2015-09-21T07:56:41.518242 #21097] ERROR -- : config/unicorn.conf.rb:122:in `check_sidekiq_heartbeat'
> E, [2015-09-21T07:56:41.518268 #21097] ERROR -- : config/unicorn.conf.rb:146:in `master_sleep'
> E, [2015-09-21T07:56:41.518292 #21097] ERROR -- : /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:295:in `join'
> E, [2015-09-21T07:56:41.518313 #21097] ERROR -- : /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/unicorn-4.8.3/bin/unicorn:126:in `<top (required)>'
> E, [2015-09-21T07:56:41.518333 #21097] ERROR -- : /var/www/discourse/vendor/bundle/ruby/2.0.0/bin/unicorn:23:in `load'
> E, [2015-09-21T07:56:41.518365 #21097] ERROR -- : /var/www/discourse/vendor/bundle/ruby/2.0.0/bin/unicorn:23:in `<main>'

```

Between 2015-09-21T07:35:07 and 2015-09-21T10:29:57 I got 17GB in unicorn.stderr.log-20150921 and another 6GB in unicorn.stderr.log, which caused my server to quit working.

This happens every now and then.

As Discourse seems to work fine while those logs are heavily written, the problem is not the low memory but the disk filled by the logs.

What cat I do to get Discourse working?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [9월 21, 2015, 9:46오후 UTC](https://meta.discourse.org/t/25gb-of-cannot-allocate-memory-logs/33533/2 "2015-09-21T21:46:34Z")

</div>

What does `free` on the box return?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [9월 22, 2015, 12:18오전 UTC](https://meta.discourse.org/t/25gb-of-cannot-allocate-memory-logs/33533/3 "2015-09-22T00:18:21Z")

</div>

Odd, we definitely do not see this happen on the many customer $99 installs, with 1GB RAM and swap out there.

Any plugins or other unusual configuration? Did you deviate from the install guide in any way?

---

<div class="post-metadata">

### Author: ![michaelgiesler](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michaelgiesler/32/46374_2.png) [@michaelgiesler](https://meta.discourse.org/u/michaelgiesler)
#### Post date: [9월 22, 2015, 5:43오전 UTC](https://meta.discourse.org/t/25gb-of-cannot-allocate-memory-logs/33533/4 "2015-09-22T05:43:48Z")

</div>

Thanks for your replies.

```
root@www:/var/discourse/shared/standalone/log/rails# free -h
              total used free shared buffers cached
Mem: 994M 929M 64M 7.7M 4.6M 36M
-/+ buffers/cache: 888M 105M
Swap: 255M 191M 64M

```

I do not have any plugins installed. It’s still the very default Discourse from your installation guide. The only thing that I can mention is that I at first tried the 512MB server from DigitalOcean and increased to 1GB when installation failed and then started once more.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [9월 22, 2015, 6:21오전 UTC](https://meta.discourse.org/t/25gb-of-cannot-allocate-memory-logs/33533/5 "2015-09-22T06:21:24Z")

</div>

Swap is tiny and below our recommendation.

---

<div class="post-metadata">

### Author: ![michaelgiesler](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michaelgiesler/32/46374_2.png) [@michaelgiesler](https://meta.discourse.org/u/michaelgiesler)
#### Post date: [9월 22, 2015, 6:53오후 UTC](https://meta.discourse.org/t/25gb-of-cannot-allocate-memory-logs/33533/6 "2015-09-22T18:53:17Z")

</div>

Thank you for this hint. I created the swap file by following a howto of DigitalOcean. Now I increased the size of the swap file and will see if it works.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [6월 8, 2024, 12:46오후 UTC](https://meta.discourse.org/t/25gb-of-cannot-allocate-memory-logs/33533/7 "2024-06-08T12:46:03Z")

</div>

이 주제는 3182일 후 자동으로 닫혔습니다. 새로운 답변은 더 이상 허용되지 않습니다.
