Skip to content

Memory leak server crash with (0.3.0) #48

@koticmit

Description

@koticmit

We are using this package in production and we are experiencing huge memory leaks.

When I continuously update the items that are subscribed in this publication then the memory is continuously increasing and server is getting crashed.
Our publication looks like this

Meteor.publish("getTwoLevelTests", function getTwoLevelTests(query) {
	this.autorun(function (computation) {
		let item = Test.findOne({ "_id": query._id }, { fields: { "links": 1 } });
		let itemIds = [];
		if (item && item.links) {
			item.links.forEach((link) => { link.linkedItemId && !itemIds.includes(item.linkedItemId) && itemIds.push(item.linkedItemId) });
		}
		return Test.find({ companyId: query.companyId,"links.linkedItemId": { $in: itemIds } })
	});
});

When I try to upgrade to latest version (0.4.0) of peerlibrary:reactive-publish I am getting this error "ReferenceError: ReactiveVar is not defined"

Can someone help here ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions