Hi all, I could use some help on this memory leak issue.
I’m struggling to find out where the memory leaks come from in my app. My containers (standard size on galaxy) are crashing every day…
I took screenshots of the past 24 hours for one instance, (same instance for all screenshots) and hopefully someone here will see something obvious that I’ve unfortunately missed so far.
I’ve hunted global variables and set them to local, but it’s possible that I missed some.
I tried also to run a separate instance with a copy of the prod database and the container stays stable when I’m the only user connected.
So it’s obviously linked with the user activity and as our audience is growing every day (one positive point at least) this problem becomes always more urgent to solve.
Looking at the charts, the problem doesn’t seem to come from the publications as they are pretty well-balanced (created, deleted).
Please let me know if you need any information that could help you understand this issue better.
@hemalr87 no, not yet. I’ve put aside this issue for (quite) some time, my server has to reboot every now and then but I will have to go through a whole code cleanup anyway. I’ll keep you posted if I can solve it and if I can point out the culprit in the process.
Please let me know if you make any progress on your side! good luck
So it seems I may have fixed it on my end - caused by a db query that was inefficient. I.e. - the function changes the status of some returned documents, but not all. I modified the query to (should have been done like this from the get go) not even return the documents that have no chance of the status changing, and it (knock on wood) seems to have been the cause of the error. Stats are looking good so far…
I have the same problem in my Meter 1.2 apps which are still on older versions and use the old mupx to deploy. Since I switched some to Meteor 1.4+ and the most recent mup, I don’t have to restart the server every couple of weeks anymore. However, I still don’t know if this has been fixed in Meter or if the new mup just restarts the app once it sees it became unresponsive.
Hi Emil,
No, I never really figured out what caused the issues. I actually killed this project which had memory leaks.
I’m working on another project that runs well and stable. It also has a much cleaner code structure.
Sorry that I cannot help more.
I think should you check code in your app to reduce publications (such as use lamhieu:hypersubs to reduce same subscriptions, use method instead of subscriptions if not need real-time tracking or try mixmax:smart-disconnect). All just is tips to optimal for your app.
with my experiences, Meteor publication is very useful but we should use publication/subscription with ONLYONE document. I mean you subscribe a document with its _id field as the key.
I don’t use publication/subscription to get a list of documents. In case I need to auto reload the list of documents, I update the list events to a document and subscribe to that document. On the events changed, use method to fetch new/updated documents.
In my case, the issue has not resurfaced since identifying and fixing the inefficient db query. Based on my singular sample size, it may be worth investigating.