# High memory use during assets precompilation

**URL:** <https://meta.discourse.org/t/high-memory-use-during-assets-precompilation/56526>\
**Category:** Development\
**Created:** [January 28, 2017, 6:57pm UTC](https://meta.discourse.org/t/high-memory-use-during-assets-precompilation/56526 "2017-01-28T18:57:49Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)\
**Post date:** [April 12, 2024, 4:58pm UTC](https://meta.discourse.org/t/high-memory-use-during-assets-precompilation/56526/6 "2024-04-12T16:58:59Z")

</div>

Could you share output of `vmstat 5` in this case? If you’re looking at `ps` or `top` then you might be seeing something other than the memory that’s in use. Allocated memory isn’t so important if it’s not in use.

For example, in ps output I see VSZ and RSS. I care about the RSS.

```plaintext
# ps uax|egrep '[0-9].unicorn|VS[Z]'
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
ddiscou+ 2192 0.0 13.4 558320 267540 ? Sl Jan10 33:21 unicorn master -E production -c config/unicorn.conf.rb
ddiscou+ 2294 0.0 18.2 5126600 363432 ? Sl Jan10 90:59 unicorn worker[0] -E production -c config/unicorn.conf.rb
ddiscou+ 2301 0.0 14.2 5149576 282892 ? Sl Jan10 38:40 unicorn worker[1] -E production -c config/unicorn.conf.rb

```

In `top` I see the same thing but it’s called VIRT and RES

```plaintext
  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND                                                          
 2284 ddiscou+ 25 5 5246644 327496 5640 S 1.7 16.4 872:50.70 ruby                                                             
 2294 ddiscou+ 20 0 5126600 364284 14436 S 0.7 18.3 91:00.13 ruby                                                             

```

vmstat tells me what the memory pressure is right now - how much swap remains, how much free memory and buffer memory, and most crucially if there’s any swap-in (the `si` column)

```plaintext
root@ubuntu-2gb-nbg1-1:~# vmstat 5 5
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r b swpd free buff cache si so bi bo in cs us sy id wa st
 0 0 239616 127080 185428 464448 0 0 14 32 4 2 2 1 97 0 0
 0 0 239616 124584 185432 464500 0 0 0 13 138 318 2 2 96 0 0
 0 0 239616 126120 185436 464500 0 0 0 13 116 264 1 0 99 0 0
 0 0 239616 120376 185436 464504 0 0 0 46 125 322 3 2 95 0 0
 0 0 239616 123448 185436 464504 0 0 0 73 129 306 1 1 98 0 0

```

---

_[View the full topic](https://meta.discourse.org/t/high-memory-use-during-assets-precompilation/56526)._
