Skip to content

ssr: memory and cpu problem #1706

@xsbchen

Description

@xsbchen

Version

2.7.0

Reproduction link

https://github.com/vuejs/vue-hackernews-2.0

Steps to reproduce

  1. git clone https://github.com/vuejs/vue-hackernews-2.0
  2. npm i
  3. add beforeRouteEnter event to src/views/CreateListView.js:
  beforeRouteEnter(to, from, next) {
    next((vm) => {
      console.log('before enter user view');
    });
  }
  1. add console.log to vue-router.common.js line 2058:
function poll (
  cb, // somehow flow cannot infer this is a function
  instances,
  key,
  isValid
) {
  if (instances[key]) {
    cb(instances[key]);
  } else if (isValid()) {
    setTimeout(function () {
      console.log('vue-router poll');
      poll(cb, instances, key, isValid);
    }, 16);
  }
}
  1. npm run dev
  2. open http://127.0.0.1:8080/

What is expected?

memory can be gc collected

What is actually happening?

memory and cpu grow up, and it keeps printing vue-router poll


cpu profier
heapdump
logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions