meteor-reactive-publish icon indicating copy to clipboard operation
meteor-reactive-publish copied to clipboard

Memory leak server crash with (0.3.0)

Open koticmit opened this issue 6 years ago • 2 comments

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 ?

koticmit avatar Jun 26 '19 05:06 koticmit

The problem with ReactiveVar should be gone.

Can you check if the latest version is still having memory issues?

mitar avatar Sep 20 '19 09:09 mitar

Could you check if #27 is the issue?

mitar avatar Sep 20 '19 09:09 mitar