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.