We use circleci as part of our deployment process. Circleci runs our 3000 tests and sometimes fails because it hits a 4 GB memory limit. It looks like some of our tests are creating a lot of objects and using up a ton of memory. I just don't know which ones are.
Is there an easy way for me to profile the memory used for a given test? If I knew how to do this, I could easily loop through each test and run it and see how much memory it uses.
You can use the ruby-prof gem to profile memory usage. But first you might try running rspec with the --profile
flag. It will give you the 10 slowest specs which is probably a good place to start looking for specs that are consuming massive amounts of memory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With