Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webpack ... Killed error ... 137 (Out of memory) #85

Closed
JasonKleban opened this issue Jun 12, 2020 · 5 comments
Closed

webpack ... Killed error ... 137 (Out of memory) #85

JasonKleban opened this issue Jun 12, 2020 · 5 comments

Comments

@JasonKleban
Copy link

I have a new Ubuntu 20 on rpi 3b+ all the way updated. This might not be a moonfire-nvr related issue at all, but I'll log it anyway since I can't find any great matches elsewhere. Following guide/install-manual.md, looks like an out-of-memory issue in the webpack step? Possibly a bad loop? cargo stuff works fine and is probably more aggressive, if I had to guess.

yarn build
yarn run v1.22.4
webpack --mode production --config webpack/prod.config.js
Killed
error Command failed with exit code 137.

I didn't try the scripted install yet. I tried upgrading all dependencies to latest with yarn, no change.

@scottlamb
Copy link
Owner

I've never seen that before but I haven't tried running yarn build on a 1 GiB machine in a while. Two ideas:

  • use zram
  • just build it on another machine and copy it over. Unlike the moonfire-nvr binary, none of the JavaScript/HTML/etc. files in the ui-dist directory are architecture- or OS-specific. So "cross-compiling" is trivial; you just build it somewhere else and copy it over.

@scottlamb
Copy link
Owner

I'm pleasantly surprised the cargo command completed. I've definitely hit errors with it before on a 1 GiB machine.

@scottlamb
Copy link
Owner

I just tried it on my Raspberry Pi 2 (currently running Ubuntu 19.10) and hit the same problem. yarn build worked after I ran these commands:

sudo apt install zram-config
sudo systemctl start zram-config

YMMV.

I also noticed that (without zram-config) a build completed at revision 88fe6e5. I think the favicons-webpack-plugin thing in the next revision (45abeb2) is pretty intensive. I might get rid of it; it's not even producing the right output for me on my NUC setup for some reason. Some of the svg paths aren't scaled properly or something so I can't actually see the full camera shape in the circle.

@JasonKleban
Copy link
Author

With those two commands I was unsuccessful with the same error. I will try to verify that zram is really enabled and/or try zswap ...

Update:

I think I was mistaken before too about cargo test - rerunning, or rerunning after cargo clean it is failing after sitting here for a long time:

Compiling moonfire-nvr v0.1.0 (/home/ubuntu/repos/moonfire-nvr)
Building [=====================================================> ] 349/350: moonfire-nvr(bin)

Ultimate printout:

...
   Compiling moonfire-nvr v0.1.0 (/home/ubuntu/repos/moonfire-nvr)
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-L" "/home/ubuntu/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-gnu/lib" "/home/ubuntu/repos/moonfire-nvr/target/debug/deps/moonfire_nvr-d6b13864861fa9ed.11egqo4j2d0bob4p.rcgu.o
...
  = note: collect2: fatal error: ld terminated with signal 9 [Killed]
          compilation terminated.

@JasonKleban
Copy link
Author

JasonKleban commented Jun 13, 2020

sudo apt install zram-config didn't have the same outcome as the instructions based here: https://github.com/StuartIanNaylor/zram-config (for example, there was no /etc/ztab file from apt, among other differences).

With the /etc/ztab updated away from the defaults as shown in the zram-config readme, yarn build finally worked on-board (284 seconds). And cargo test (261 seconds - but this speed is probably from resuming partially successful runs previously) with all tests passing. cargo build --release (72 minutes)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants