-
Notifications
You must be signed in to change notification settings - Fork 35
OOM errors in Docker #48
Comments
Hey @raybradley, Looks like you may have multiple circular references. To limit them, either enable Both of this options are available through the Cheers |
I'm afraid I'm missing something here. Given this config block:
...the app complains thusly:
Ideas? Is the option documented as part of the contentful_rails gem and I'm missing it? |
I personally recommend enabling |
Thanks @shaug ... that was non-obvious :) Why do you recommend |
Hey @raybradley, It depends, reuse_entries will be more performant and will take less memory, but this is at the cost of disabling caching capabilities when having circular references, as it will generate a stack level too deep error. Reducing the maximum include resolution limit, while a bit less perfomant when having circular references, has the same performance and uses the same amount of memories when dealing with unique objects. When having circular references, as the referenced objects do not point to the same address and are actually limited in depth, you can safely use caching mechanisms without being afraid of getting stack too deep exceptions. Hope that explains it a little bit better. Cheers |
Thanks for the suggestions, but unfortunately it's still happening. Anything further you all would recommend to troubleshoot or profile the calls I'm making? |
Hey @raybradley, I'd suggest using something like NewRelic to check what's the memory bottleneck you're having. So that we can have a better idea of what may be the cause of your issue. In the meantime, I'd suggest limiting your request size to an amount you can handle with the memory constraints you have. You can do so by using the Hope this helps, Cheers |
Hey @dlitvakb, Looks like adding both Thanks! |
Hey @keithm-thompson, They serve different purposes, so you can safely use both together. The first is for avoiding recreating entry objects if they are reused somewhere along the hydration process, the second one is to limit the amount of chaining on long chains of unique objects (if you enable Cheers |
We're seeing fairly heavy RAM consumption when performing basic queries:
@tests = TestProduct.all.order('name').load
We suspect this is due to eager loading, as TestProducts have a number of associations (only a handful of actual TestProducts exist). We've tried suppressing eager loading as described here, but no dice.
Any ideas?
The text was updated successfully, but these errors were encountered: