decrease memory consumption - Update sprockets... #156
+9
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
... 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: