Elasticsearch-js: Memory leaks in .get() and .mget()

Created on 18 Sep 2016  路  1Comment  路  Source: elastic/elasticsearch-js

"elasticsearch": "^11.0.1"

There seems to be a leak with lodash arrays, filling up memory and causing processes/containers to crash with simple .get() and .mget() operations.

'use strict'

const elasticsearch = require('elasticsearch')

let client = new elasticsearch.Client()
let i = 0

let mget = [{
  _id: 'one',
  _type: 'test',
  _index: 'test-dev',
  _source: true
}, {
  _id: 'two,
  _type: 'test',
  _index: 'test-dev',
  _source: true
}, {
  _id: 'three',
  _type: 'test',
  _index: 'test-dev',
  _source: true
}, {
  _id: 'four',
  _type: 'test',
  _index: 'test-dev',
  _source: true
}]

setInterval(() => {
  client.mget({
    body: {
      docs: mget
    }
  }, (e, r) => {
    console.log('interval:', i++, require('util').inspect(process.memoryUsage()))
  })
}, 50)

bug pending release

Most helpful comment

This should be fixed in v13

>All comments

This should be fixed in v13

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ablakey picture ablakey  路  4Comments

rtercias picture rtercias  路  4Comments

mfaizanse picture mfaizanse  路  3Comments

kaustavghosh06 picture kaustavghosh06  路  5Comments

shenieee09 picture shenieee09  路  4Comments