Rails 6 Memory Bloat on Boot
Set compile: false
for production in webpacker.yml.
compile: true
means: run webpack compilation during the request cycle, something you most likely do not want to do in production since you would instead precompile your assets.
Ways to avoid memory bloat in rails when instantiating a large number of objects?
You should try pluck
instead of select
, that won't give you objects, just the fields in an array. That should help your memory situation. Check out the docs for more info.
Prawn PDF causing memory bloat in heroku rails app
In case anyone is looking at this in the future - Ruby GC looked to be messing up. Simply dereferencing the pdf (pdf = nil
) ensured it was garbage collected.
Related Topics
Best Way to Create a Blog with Static Pages in Ruby
Using a Self-Signed Certificate
What's an Example of Ruby Code That's "Too Clever"
Define_Method with Predefined Keyword Arguments
Regex to Check Alphanumeric String in Ruby
Permission Error When Trying to Install Rails (Osx)
Ruby: Parse Excel 95-2003 Files
Shellwords.Shellescape Implementation for Ruby 1.8
How to Properly Manage The Rails Tmp Directory
Spawning an Independent Thread or Process in Ruby
How to Have Two Columns in One Table Point to The Same Column in Another with Activerecord
Why The Unit Test Frameworks in Fortran Rely on Ruby Instead of Fortran Itself
How to Print a Multi-Dimensional Array in Ruby
Modifying Text Inside HTML Nodes - Nokogiri
How to Access Sinatra App on Host Machine with Vagrant Forwarded Ports