-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate increased memory usage #90
Comments
Running multiple instances with bots/subreddits separated by common functionality like so:
In all cases memory ballooning did not seem to correlate to any specific behaviors. It was still occurring across all instances and at random -- both for when it occurred and how often it occurred. Added memory monitoring in 4196d2a and ce99009 that invokes There is no obvious root cause and no rhyme or reason to ballooning which leads me too.... GC is lazy More than a few sources I've read point to node's GC being greedy (using as much memory as is free to it) and lazy (waiting until last moment possible to collect). https://blog.heroku.com/node-habits-2016#7-avoid-garbage
https://devcenter.heroku.com/articles/node-memory-use#tuning-the-garbage-collector
https://medium.com/geekculture/node-js-default-memory-settings-3c0fe8a9ba1
While not a solution for the root cause it should be possible to rein in memory usage by using node --optimize_for_size --max_old_space_size=512 src/index.js run or as env
( Will try this with docker containers to see if it makes a difference and if it does will add guidance to docs for now. |
I'm going to close this for now. If it crops up again will re-open. |
Coinciding with database support I have seen an increase in memory. Whether this is due to typeorm and poor coding on my part is not clear yet...
Most likely my scenario is a worst case since I am doing the most with CM -- 70+ subreddits across 20+ bots with a few doing image comparison (using sharp).
Memory snapshots from init, after loading all configs, and a few minutes after running show tiny deltas (a few MB) but RSS on linux shows 100-200MB. Additionally, eventually there is a huge increase in usage ballooning to ~1.4GB. The memory snapshot still stays tiny which makes me think this is non-heap. Some speculation:
Also need to do more research to verify memory usage is actually non-heap and not something obvious im missing in memory snapshot or explained by some node utility i haven't used yet (like process.memoryUsage())
The text was updated successfully, but these errors were encountered: