Skip to content
This repository was archived by the owner on Jun 23, 2020. It is now read-only.

Paging API keeps links to all previous pages #12

@ibash

Description

@ibash

Hi Thomas,

This code keeps a reference to a parent: https://github.com/tstachl/desk.js/blob/develop/lib/resource/index.js#L22

And this code creates references to newResources: https://github.com/tstachl/desk.js/blob/develop/lib/mixins/link.js#L41

This makes it so that if you're paging through resources, the garbage collector can't collect pages you've already seen. It's not until you've finished consuming all the pages that that garbage collector can clean things up. We saw this result in popping the node.js memory limit in some of our processes.

This is how we fixed it: Datahero@a255840

Parent links are always to the root object so that getting the client works. Paging functions delete themselves after being used, so they're one time use only.

This might break the current API if you try to get the same page twice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions