question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nuxt SSR has memory leak when feather-vuex is connected

See original GitHub issue

Steps to reproduce

  1. Clone this https://github.com/DreaMinder/feathers-vuex-leak-reproduction, run npm i
  2. Run npm start
  3. Run 'npm load` in separate terminal (maybe multiple times)
  4. Watch for memory usage and terminal errors

Expected behavior

Stable memory usage

Actual behavior

  1. Terminal throws error (node:10032) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 removed listeners added. Use emitter.setMaxListeners() to increase limit
  2. Memory usage increases under load and remains high while idle.
  3. When memory usage hits limit, process crashes.

System configuration

Tested on ubuntu\osx\windows. Both feathers-vuex 1.0 and 2.0.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
guzzcommented, Dec 14, 2019

I had the same issue but is easly fixed with disallowing events on the server:

const { makeServicePlugin, makeAuthPlugin, BaseModel, models, FeathersVuex } = feathersVuex(
  feathersClient,
  {
    serverAlias: 'api', // optional for working with multiple APIs (this is the default value)
    idField: '_id', // Must match the id field in your database table/collection
    whitelist: ['$regex', '$options'],
    enableEvents: process.client
  }
)

I was working on a documentation update but the latest version 2.3.1 broke somethings for me…

1reaction
marshallswaincommented, Dec 19, 2019

I’ve added this to the 3.0 docs. Will be shipping soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solving server-side memory leaks on Nuxt.js - Medium
Here's what we do now to test properly if we have memory leaks on a local server. To detect memory leaks, we use...
Read more >
Nuxt | FeathersVuex
Preventing Memory Leaks. The default settings of Feathers-Vuex include having realtime events enabled by default. This will result in increased memory usage ...
Read more >
Nuxt huge memory usage / leakage and how to prevent
I think it is time to share my understanding (even though it's little):. #1 as vue-router use prefetch there may be heavy memory...
Read more >
Common memory leak issues in nuxt.js
Incorrect practices of using methods and data in vue files. Sometimes inner array operations might introduce an infinite loop too. If we have...
Read more >
Any advice on finding a memory leak? Mode: SSR : r/Nuxt
7.1K subscribers in the Nuxt community. Nuxt is a JavaScript framework for creating Universal Vue.js Applications.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found