-
-
Save cddr/5470822 to your computer and use it in GitHub Desktop.
Finding a memory leak in ruby2/rails4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#You Only Leak Once | |
# Install valgrind using one of the following | |
brew install valgrind | |
sudo apt-get install vagrind | |
# make sure valgrind is enabled in your ruby build | |
CONFIGURE_OPTS="--with-valgrind" rbenv install 2.0.0-p0 | |
# control test (should not show any memory leaks) | |
valgrind --leak-check=full -v ruby -e "puts 'yolo'" | |
# one of our unit tests (takes a lot longer than running the test normally) | |
valgrind --trace-children=yes --leak-check=full -v ruby -Ilib:test test/unit/publisher_test.rb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment