jasonish / evebox

Web Based Event Viewer (GUI) for Suricata EVE Events in Elastic Search
https://evebox.org/
MIT License
432 stars 67 forks source link

Javascript Heap error memory #119

Closed TheThingGoesSkra closed 4 years ago

TheThingGoesSkra commented 5 years ago

Hello, I'm trying to build evebox on a Raspberry Pi 3B+ with Raspbian but I have this error. I have already installed and make dependencies. Do you know where it could have come from plz ?

pi@raspberrypi:/opt/evebox $ sudo make cd webapp && make make[1]: Entering directory '/opt/evebox/webapp' Exporting GITREV = 9856ecf. Building EveBox webapp rev 9856ecf. ./node_modules/.bin/ng build --aot --prod --output-path ../resources/public --deploy-url "public/" 68% building 488/490 modules 2 active .../theme-light.scss
<--- Last few GCs --->

[11693:0x333f5f8] 343030 ms: Mark-sweep 225.1 (234.5) -> 223.3 (234.5) MB, 1089.6 / 0.3 ms (average mu = 0.258, current mu = 0.228) allocation failure scavenge might not succeed [11693:0x333f5f8] 344653 ms: Mark-sweep 225.2 (234.5) -> 223.3 (234.5) MB, 1175.0 / 0.3 ms (average mu = 0.267, current mu = 0.276) allocation failure scavenge might not succeed

<--- JS stacktrace --->

==== JS stack trace =========================================

0: ExitFrame [pc: 0xe50420]
1: StubFrame [pc: 0xebed84]

Security context: 0x329ce225 2: xF [0x738c5595] [/opt/evebox/webapp/node_modules/sass/sass.dart.js:1] [bytecode=0x4a042275 offset=0](this=0x6d4f8cb9 ,0x4c217429 ) 3: hF [0x738c53d5] [/opt/evebox/webapp/node_modules/sass/sass.dart.js:19754] [bytecode=0x4a040a71 offset=7](this=0x6d4f8cb9 ,0x4c2174...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

Writing Node.js report to file: report.20191114.160456.11693.0.001.json Node.js report completed Aborted make[1]: [Makefile:26: build] Error 134 make[1]: Leaving directory '/opt/evebox/webapp' make: [Makefile:65: resources/public/_done] Error 2

jasonish commented 5 years ago

This failure is coming out of the JavaScript build tools. Unfortunately I don't know these tools very well so won't be of any help.

thiscantbeserious commented 4 years ago

You need to increase Heap-Size for node.js (otherwise V8 is limited to 1.7GB) by exporting this environment variable either temporary for the session or by adding it to your .bashrc:

export NODE_OPTIONS="--max-old-space-size=4096"

You could also fix the Makefile by adding it as an argument to the build command for everything involving NodeJS. But I recon simply using the above global options are a better way of solving this issue once and for all.

TheThingGoesSkra commented 4 years ago

Thank you very much ! A friend found it earlier.

jasonish commented 4 years ago

You need to increase Heap-Size for node.js (otherwise V8 is limited to 1.7GB) by exporting this environment variable either temporary for the session or by adding it to your .bashrc:

export NODE_OPTIONS="--max-old-space-size=4096"

You could also fix the Makefile by adding it as an argument to the build command for everything involving NodeJS. But I recon simply using the above global options are a better way of solving this issue once and for all.

Thanks for this feedback. I'll try to incorporate it into the build script, even if only as a comment.

jasonish commented 4 years ago

Closing. Added to the README.