elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.8k stars 8.19k forks source link

Kibana 7.5.2 plugin runs out of heap memory. #53804

Closed geekyogurt closed 4 years ago

geekyogurt commented 4 years ago

Kibana version: 7.5.2

Elasticsearch version: 7.5.2

Original install method (e.g. download page, yum, from source, etc.): from source. Running using yarn start

Describe the bug: Created a new sample plugin. running yarn start throws running out of memory error. This error is not encountered in kibana version 7.1.1.

Steps to reproduce:

  1. Clone the kibana github repo. Follow the steps on CONTRIBUTING.md to setup elastic search and kibana.
  2. run node scripts/generate_plugin sample_plugin to create a sample plugin.
  3. run cd plugins/sample_plugin && yarn start

Provide logs and/or server output (if relevant):

<--- Last few GCs --->

[3291:0x102640000]    78728 ms: Mark-sweep 1052.2 (1343.7) -> 1051.8 (1296.7) MB, 643.5 / 0.0 ms  (average mu = 0.634, current mu = 0.000) last resort GC in old space requested
[3291:0x102640000]    79331 ms: Mark-sweep 1051.8 (1296.7) -> 1051.8 (1283.2) MB, 602.5 / 0.0 ms  (average mu = 0.464, current mu = 0.000) last resort GC in old space requested

<--- JS stacktrace --->

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

Security context: 0x29f51c39e6e1 <JSObject>
    0: builtin exit frame: parse(this=0x29f51c391a19 <Object map = 0x29f5c64842a9>,0x29f5406f34e9 <Very long string[126074545]>,0x29f51c391a19 <Object map = 0x29f5c64842a9>)

    1: toPojo(aka toPojo) [0x29f5cbac3e21] [/Users/aravinda/Biomarin/kibana/src/legacy/server/logging/apply_filters_to_keys.js:27] [bytecode=0x29f522fe0d31 offset=30](this=0x29f5999826f1 <undefined>,obj=0x29f5a8674b51 <Obje...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: 0x10003b1db node::Abort() [/Users/aravinda/.nvm/versions/node/v10.15.2/bin/node]
 2: 0x10003b3e5 node::OnFatalError(char const*, char const*) [/Users/aravinda/.nvm/versions/node/v10.15.2/bin/node]
 3: 0x1001a86b5 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/Users/aravinda/.nvm/versions/node/v10.15.2/bin/node]
 4: 0x100573ad2 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/Users/aravinda/.nvm/versions/node/v10.15.2/bin/node]
 5: 0x10057cfd4 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/Users/aravinda/.nvm/versions/node/v10.15.2/bin/node]
 6: 0x10054edc4 v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [/Users/aravinda/.nvm/versions/node/v10.15.2/bin/node]
 7: 0x100680979 v8::internal::String::SlowFlatten(v8::internal::Handle<v8::internal::ConsString>, v8::internal::PretenureFlag) [/Users/aravinda/.nvm/versions/node/v10.15.2/bin/node]
 8: 0x100266d8a v8::internal::Builtin_Impl_JsonParse(v8::internal::BuiltinArguments, v8::internal::Isolate*) [/Users/aravinda/.nvm/versions/node/v10.15.2/bin/node]
 9: 0x18a2c02dbf9d
10: 0x18a2c02918d5
11: 0x18a2c02918d5
TinaHeiligers commented 4 years ago

@geekyogurt You need to increase your memory. The docs give several options for doing so, depending on your environment. If you're running Kibana on a Mac, adding NODE_OPTIONS="--max-old-space-size=4000" to your yarn start command should work.

elasticmachine commented 4 years ago

Pinging @elastic/kibana-platform (Team:Platform)

geekyogurt commented 4 years ago

@TinaHeiligers I tried NODE_OPTIONS='--max-old-space-size=4000" to the yarn start command. This doesn't seem to work. Also I face this problem in 7.5.2 and not in 7.1.1. When I run yarn start NODE_OPTIONS='--max-old-space-size=4000, it stalls at the following warning:

[warning][licensing][plugins] License information could not be obtained from Elasticsearch for the [data] cluster. [security_exception] missing authentication credentials for REST request [/_xpack], with { header={ WWW-Authenticate="Basic realm=\"security\" charset=\"UTF-8\"" } } :: {"path":"/_xpack","statusCode":401,"response":"{\"error\":{\"root_cause\":[{\"type\":\"security_exception\",\"reason\":\"missing authentication credentials for REST request [/_xpack]\",\"header\":{\"WWW-Authenticate\":\"Basic realm=\\\"security\\\" charset=\\\"UTF-8\\\"\"}}],\"type\":\"security_exception\",\"reason\":\"missing authentication credentials for REST request [/_xpack]\",\"header\":{\"WWW-Authenticate\":\"Basic realm=\\\"security\\\" charset=\\\"UTF-8\\\"\"}},\"status\":401}","wwwAuthenticateDirective":"Basic realm=\"security\" charset=\"UTF-8\""}
TinaHeiligers commented 4 years ago

@geekyogurt your issue is more of a user question, and we'd like to direct these kinds of things to the Kibana forum. If you can stop by there, we'd appreciate it. This allows us to use GitHub for verified bug reports, feature requests, and pull requests.

There's an active community in the forum that should be able to help get an answer to your question. As such, I hope you don't mind that I close this.

ebuildy commented 4 years ago

I still cant believe that elasticsearch UI (Kibana) uses more memory than elasticsearch :p