Skip to content
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

Add a memory profiler task #137

Merged
merged 1 commit into from
Apr 26, 2019
Merged

Add a memory profiler task #137

merged 1 commit into from
Apr 26, 2019

Conversation

jage
Copy link
Contributor

@jage jage commented Apr 26, 2019

@jage
Copy link
Contributor Author

jage commented Apr 26, 2019

Example output:

$ bundle exec rake memory_profile:parse | cat | head -n 9
Total allocated: 26032264 bytes (288004 objects)
Total retained:  0 bytes (0 objects)

allocated memory by gem
-----------------------------------
  19092216  addressable-2.6.0
   6004040  public_suffix-3.0.3
    936008  twingly-url/lib

@walro
Copy link
Contributor

walro commented Apr 26, 2019

$ bundle exec rake memory_profile:parse | cat | head -n 9

Curious, why the piping to cat in between?

@jage
Copy link
Contributor Author

jage commented Apr 26, 2019

Ah, just wanted to keep the pipe open a bit longer, I guess there are better ways to do that ... :)

Without it:

$ bundle exec rake memory_profile:parse |  head -n 9
Total allocated: 25536256 bytes (286004 objects)
Total retained:  0 bytes (0 objects)

allocated memory by gem
-----------------------------------
  19092216  addressable-2.6.0
   6004040  public_suffix-3.0.3
    440000  twingly-url/lib

rake aborted!
Errno::EPIPE: Broken pipe @ io_writev - <STDOUT>
/Users/jage/.gem/ruby/2.6.2/gems/memory_profiler-0.9.13/lib/memory_profiler/results.rb:156:in `write'
/Users/jage/.gem/ruby/2.6.2/gems/memory_profiler-0.9.13/lib/memory_profiler/results.rb:156:in `puts'
/Users/jage/.gem/ruby/2.6.2/gems/memory_profiler-0.9.13/lib/memory_profiler/results.rb:156:in `block (2 levels) in dump_strings'
/Users/jage/.gem/ruby/2.6.2/gems/memory_profiler-0.9.13/lib/memory_profiler/results.rb:155:in `each'
/Users/jage/.gem/ruby/2.6.2/gems/memory_profiler-0.9.13/lib/memory_profiler/results.rb:155:in `block in dump_strings'
/Users/jage/.gem/ruby/2.6.2/gems/memory_profiler-0.9.13/lib/memory_profiler/results.rb:153:in `each'
/Users/jage/.gem/ruby/2.6.2/gems/memory_profiler-0.9.13/lib/memory_profiler/results.rb:153:in `dump_strings'
/Users/jage/.gem/ruby/2.6.2/gems/memory_profiler-0.9.13/lib/memory_profiler/results.rb:134:in `pretty_print'
/Users/jage/Source/twingly/twingly-url/profile/profile.rb:41:in `measure'
/Users/jage/Source/twingly/twingly-url/profile/Rakefile:18:in `block (2 levels) in <top (required)>'
/Users/jage/.rubies/ruby-2.6.2/bin/bundle:23:in `load'
/Users/jage/.rubies/ruby-2.6.2/bin/bundle:23:in `<main>'
Tasks: TOP => memory_profile:parse
(See full trace by running task with --trace)

@jage jage merged commit 560be62 into master Apr 26, 2019
@jage jage deleted the memory-profiler branch April 26, 2019 14:41
@walro
Copy link
Contributor

walro commented Apr 26, 2019

Ah, thanks. (https://superuser.com/a/554896 a good explanation what happens)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants