-
Notifications
You must be signed in to change notification settings - Fork 323
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
decrease memory consumption - Update sprockets... #156
Conversation
... to 4.0 for ruby >=2.5.0
I assume we should get rid of the sass gem altogether and use sassc instead: https://sass-lang.com/blog/ruby-sass-is-unsupported |
I think we can just use sassc as a drop in replacement and require it here instead of sass and remove sass from the smashing.gemspec. tests on my site look ok |
+1 |
sprockets 4.0 requires ruby 2.5.0 or higher. so i have required sass / sassc based on the ruby version. |
note that sprockets seems to have a problem on some ruby versions: sass/sassc-ruby#133 |
Two days ago sassc 2.3.0 has been released. looks ok as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... to 4.0 for ruby >=2.5.0
sprockets 4.0 requires ruby 2.5.0 and tries to autoload sassc.
first of all I'm not a ruby dev, so this might not be the perfect solution and I'm looking forward to your feedback.
I'm running smashing on a Raspberry Pi 3 Model B Plus Rev 1.3 and run out of memory over time.
I found some issues in my jobs, but I also want to ask if someone can help with this.
I used the approach described in
https://samsaffron.com/archive/2015/03/31/debugging-memory-leaks-in-ruby
therefore I added rbtrace to my Gemfile and added the following to my config.ru file:
after that I'm able to create a heap dump with:
bundle exec rbtrace -p <process-id> -e 'Thread.new{GC.start;require "objspace";io=File.open("/tmp/ruby-heap.dump", "w"); ObjectSpace.dump_all(output: io); io.close}'
with the help of the heapy gem I ran some analysis:
heapy read /tmp/ruby-heap.dump
heapy read /tmp/ruby-heap.dump all
and found that sprockets/mime.rb is on the top of all the outputs.
Something similar is discussed here: rails/sprockets#432
before the change:
After the change: