# 内存不足杀手导致引导失败

**URL:** <https://meta.discourse.org/t/failed-to-bootstrap-due-to-out-of-memory-killer/188141>\
**Category:** Bug\
**Created:** [2021年四月26日 13:16 UTC](https://meta.discourse.org/t/failed-to-bootstrap-due-to-out-of-memory-killer/188141 "2021-04-26T13:16:42Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [2021年四月26日 19:16 UTC](https://meta.discourse.org/t/failed-to-bootstrap-due-to-out-of-memory-killer/188141/18 "2021-04-26T19:16:52Z")

</div>

这个测试辅助文件对压缩的压力很大。

- UglifyJS 压缩它需要占用 1.5GB 内存。
- Terser 占用略高于 1GB，耗时 40 秒。相比之下，同一台服务器处理 Ember+jQuery 仅需 8 秒 😱

@eviltrout 我们真的需要在生产环境中保留这个文件吗？

哦，看起来它来自 @Osama 的这次更改：

> <https://github.com/discourse/discourse/pull/12815>
>
> This PR allows site admins to run theme tests in production via a new \`/theme-qu…nit\` route. When you visit \`/theme-qunit\`, you'll see a list of the themes/components installed on your site that have tests, and from there you can select a theme or component that you run its tests.
> 
> We also have a new rake task \`themes:install\_and\_test\` that installs a list of themes/components on a temporary database and runs the tests of the themes/components that are installed. This rake task can be useful when upgrading/deploying a Discourse instance to make sure that the installed themes/components are compatible with the new Discourse version being deployed, and if the tests fail you can abort the build/deploy process so you don't end up with a broken site.

```plaintext
-rw-r--r-- 1 discourse discourse 14M Apr 26 19:13 _test_helper-f4c4b5bf0657eab910d85b9a65b4bddbbbe2ce2ba603b17fe11b3d633d324e34.js
-rw-r--r-- 1 discourse discourse 6.6M Apr 26 19:14 test_helper-f4c4b5bf0657eab910d85b9a65b4bddbbbe2ce2ba603b17fe11b3d633d324e34.js
-rw-r--r-- 1 discourse discourse 1.1M Apr 26 19:14 test_helper-f4c4b5bf0657eab910d85b9a65b4bddbbbe2ce2ba603b17fe11b3d633d324e34.js.br
-rw-r--r-- 1 discourse discourse 1.5M Apr 26 19:14 test_helper-f4c4b5bf0657eab910d85b9a65b4bddbbbe2ce2ba603b17fe11b3d633d324e34.js.gz
-rw-r--r-- 1 discourse discourse 5.7M Apr 26 19:14 test_helper-f4c4b5bf0657eab910d85b9a65b4bddbbbe2ce2ba603b17fe11b3d633d324e34.js.map

```

---

_[View the full topic](https://meta.discourse.org/t/failed-to-bootstrap-due-to-out-of-memory-killer/188141)._
