Every repository with this icon (
Every repository with this icon (
| Description: | Every Rails page has footnotes that gives information about your application and links back to your editor edit |
-
After just a few page loads, any application I have that uses this gem will be using far more memory than it should be. Removing the the reference to the rails-footnotes gem causes the memory usage to stay sane.
Here is the output of
ps auxfor the script/server instance after startup, 1 request, and 5 requests.With rails-footnotes
USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND jqr 70414 0.3 1.1 121752 47372 s003 S+ 8:23PM 0:03.16 ruby ./script/server # after startup jqr 70414 0.2 17.6 813248 738492 s003 S+ 8:23PM 0:06.90 ruby ./script/server # after 1st request jqr 70414 0.3 18.1 835816 761180 s003 S+ 8:23PM 0:21.53 ruby ./script/server # after 5th request
Without rails-footnotes
USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND jqr 70605 0.3 0.8 109816 35436 s003 S+ 8:30PM 0:02.68 ruby ./script/server # after startup jqr 70605 0.3 1.3 127536 52916 s003 S+ 8:30PM 0:03.56 ruby ./script/server # after 1st request jqr 70605 0.3 1.3 129408 54904 s003 S+ 8:30PM 0:08.17 ruby ./script/server # after 5th request
I'm running the latest gem josevalim-rails-footnotes from github.
There seem to be other reports of this issue: http://github.com/drnic/rails-footnotes/commit/68fddf407ba2f2abf493d6c43be481cd0a9a01b9
Comments
-
RpmNoteNote calling undefined transaction_sampler method
1 comment Created 6 months ago by jqrThe newrelic rpm note code is calling a non-existent method called transaction_sampler on the NewRelic::Agent::Agent instance. This exception error is repeated in the log with every request.
I am using the latest version of the newrelic_rpm gem, 2.8.11.
Footnotes Footnotes::Notes::RpmNoteNote Exception: undefined method `transaction_sampler' for # /Library/Ruby/Gems/1.8/gems/josevalim-rails-footnotes-3.6.0/lib/rails-footnotes/notes/rpm_note.rb:7:in `initialize' /Library/Ruby/Gems/1.8/gems/josevalim-rails-footnotes-3.6.0/lib/rails-footnotes/footnotes.rb:133:in `new' /Library/Ruby/Gems/1.8/gems/josevalim-rails-footnotes-3.6.0/lib/rails-footnotes/footnotes.rb:133:in `initialize_notes!' /Library/Ruby/Gems/1.8/gems/josevalim-rails-footnotes-3.6.0/lib/rails-footnotes/footnotes.rb:64:in `each_with_rescue' /Library/Ruby/Gems/1.8/gems/josevalim-rails-footnotes-3.6.0/lib/rails-footnotes/footnotes.rb:62:in `each' /Library/Ruby/Gems/1.8/gems/josevalim-rails-footnotes-3.6.0/lib/rails-footnotes/footnotes.rb:62:in `each_with_rescue' /Library/Ruby/Gems/1.8/gems/josevalim-rails-footnotes-3.6.0/lib/rails-footnotes/footnotes.rb:335:in `each_with_rescue' /Library/Ruby/Gems/1.8/gems/josevalim-rails-footnotes-3.6.0/lib/rails-footnotes/footnotes.rb:132:in `initialize_notes!' /Library/Ruby/Gems/1.8/gems/josevalim-rails-footnotes-3.6.0/lib/rails-footnotes/footnotes.rb:126:in `add_footnotes_without_validation!' /Library/Ruby/Gems/1.8/gems/josevalim-rails-footnotes-3.6.0/lib/rails-footnotes/footnotes.rb:104:in `add_footnotes!' /Library/Ruby/Gems/1.8/gems/josevalim-rails-footnotes-3.6.0/lib/rails-footnotes/footnotes.rb:39:in `after'
Comments
-
Fails to produce edit pages with controllers produced from gems
1 comment Created 6 months ago by aunderwoI am using the thoughtbot clearance gem which provides some contollers for authentication. Footnotes fails to produce the edit link for the controller with the following error in the log
Footnotes #<Footnotes::Notes::ControllerNote:0xb72e8e2c>Note Exception: No such file or directory - /home/f0/anthony/rails/test_clearance_template/app/controllers/clearance/sessions_controller.rb
However it does work for the views e.g the link for the new session page
txmt://open?url=file:///usr/lib/ruby/gems/1.8/gems/thoughtbot-clearance-0.6.6/app/views/sessions/new.html.erb&line=1&column=1Note the path is pointing to the system gem folder
Comments
-
Hi,
there are exception on rendering:Footnotes LayoutNote Exception: undefined method `_pick_template' for #<ActionView::Base:0x262b324>
/Users/alec/Documents/Projects/Workspaces/my projects/my_id/vendor/plugins/rails-footnotes/lib/notes/layout_note.rb:25:in `send'
/Users/alec/Documents/Projects/Workspaces/my projects/my_id/vendor/plugins/rails-footnotes/lib/notes/layout_note.rb:25:in `layout_template'
/Users/alec/Documents/Projects/Workspaces/my projects/my_id/vendor/plugins/rails-footnotes/lib/notes/layout_note.rb:20:in `valid?'
maybe this plugin have any prerequisites?
Comments
No prequesites. Which rails are you using? If it's not Rails 2.3.2 (not tested on Rails 2.3.3, but it should work) be sure to check the README to see the proper version for you.
under my cirmustance (rails 2.3.4)
same problem happensany idea?
Someone reported me it's not Rails 2.3.3 compatible. Probably not 2.3.4, I will fix it when I have some time to look at it.
please report status on this one. I have it running on 2.3.4
According to apidock _pick_template is a deprecated method after Rails 2.2.1:
http://apidock.com/rails/ActionView/Base/pick_template?q=pick_template
-
Sorry, feeling lazy, just want to report this bug:
Footnotes #<Footnotes::Notes::ControllerNote:0x25ea2c0>Note Exception: undefined method `to_a' for #<String:0x25b8f54> /Users/drnic/Sites/pharmmd/vendor/plugins/rails-footnotes/lib/rails-footnotes/notes/controller_note.rb:54:in `lines_from_index' /Users/drnic/Sites/pharmmd/vendor/plugins/rails-footnotes/lib/rails-footnotes/notes/controller_note.rb:48:in `controller_line_number' /Users/drnic/Sites/pharmmd/vendor/plugins/rails-footnotes/lib/rails-footnotes/notes/controller_note.rb:15:in `link' /Users/drnic/Sites/pharmmd/vendor/plugins/rails-footnotes/lib/rails-footnotes/footnotes.rb:305:in `link_helper' /Users/drnic/Sites/pharmmd/vendor/plugins/rails-footnotes/lib/rails-footnotes/footnotes.rb:252:in `block in links' /Users/drnic/Sites/pharmmd/vendor/plugins/rails-footnotes/lib/rails-footnotes/footnotes.rb:64:in `block in each_with_rescue' /Users/drnic/Sites/pharmmd/vendor/plugins/rails-footnotes/lib/rails-footnotes/footnotes.rb:62:in `each' /Users/drnic/Sites/pharmmd/vendor/plugins/rails-footnotes/lib/rails-footnotes/footnotes.rb:62:in `each_with_rescue' /Users/drnic/Sites/pharmmd/vendor/plugins/rails-footnotes/lib/rails-footnotes/footnotes.rb:335:in `each_with_rescue' /Users/drnic/Sites/pharmmd/vendor/plugins/rails-footnotes/lib/rails-footnotes/footnotes.rb:250:in `links' /Users/drnic/Sites/pharmmd/vendor/plugins/rails-footnotes/lib/rails-footnotes/footnotes.rb:190:in `insert_footnotes' /Users/drnic/Sites/pharmmd/vendor/plugins/rails-footnotes/lib/rails-footnotes/footnotes.rb:128:in `add_footnotes_without_validation!' /Users/drnic/Sites/pharmmd/vendor/plugins/rails-footnotes/lib/rails-footnotes/footnotes.rb:104:in `add_footnotes!' /Users/drnic/Sites/pharmmd/vendor/plugins/rails-footnotes/lib/rails-footnotes/footnotes.rb:39:in `after'Comments
-
=> Rails 2.3.2 application starting on http://0.0.0.0:3000 /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/module/aliasing.rb:33:in `alias_method': undefined method `execute' for class `ActiveRecord::ConnectionAdapters::MysqlAdapter' (NameError) from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/module/aliasing.rb:33:in `alias_method_chain' from /opt/local/lib/ruby/gems/1.8/gems/josevalim-rails-footnotes-3.6.2/lib/rails-footnotes/notes/queries_note.rb:124:in `included' from /opt/local/lib/ruby/gems/1.8/gems/josevalim-rails-footnotes-3.6.2/lib/rails-footnotes/notes/queries_note.rb:123:in `class_eval' from /opt/local/lib/ruby/gems/1.8/gems/josevalim-rails-footnotes-3.6.2/lib/rails-footnotes/notes/queries_note.rb:123:in `included' from /opt/local/lib/ruby/gems/1.8/gems/josevalim-rails-footnotes-3.6.2/lib/rails-footnotes/notes/queries_note.rb:170:in `include' from /opt/local/lib/ruby/gems/1.8/gems/josevalim-rails-footnotes-3.6.2/lib/rails-footnotes/notes/queries_note.rb:170:in `send' from /opt/local/lib/ruby/gems/1.8/gems/josevalim-rails-footnotes-3.6.2/lib/rails-footnotes/notes/queries_note.rb:170 from /opt/local/lib/ruby/gems/1.8/gems/josevalim-rails-footnotes-3.6.2/lib/rails-footnotes/notes/queries_note.rb:167:in `each' from /opt/local/lib/ruby/gems/1.8/gems/josevalim-rails-footnotes-3.6.2/lib/rails-footnotes/notes/queries_note.rb:167 from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `polyglot_original_require' from /opt/local/lib/ruby/gems/1.8/gems/polyglot-0.2.9/lib/polyglot.rb:70:in `require' from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require' from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in' from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require' from /opt/local/lib/ruby/gems/1.8/gems/josevalim-rails-footnotes-3.6.2/lib/rails-footnotes.rb:9 from /opt/local/lib/ruby/gems/1.8/gems/josevalim-rails-footnotes-3.6.2/lib/rails-footnotes.rb:8:in `each' from /opt/local/lib/ruby/gems/1.8/gems/josevalim-rails-footnotes-3.6.2/lib/rails-footnotes.rb:8 from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `polyglot_original_require' from /opt/local/lib/ruby/gems/1.8/gems/polyglot-0.2.9/lib/polyglot.rb:70:in `require' from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require' from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in' from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require' from /opt/local/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/gem_dependency.rb:179:in `load' from /opt/local/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:305:in `load_gems' from /opt/local/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:305:in `each' from /opt/local/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:305:in `load_gems' from /opt/local/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:167:in `process' from /opt/local/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:113:in `send' from /opt/local/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:113:in `run' from /Users/jonas/Development/projects/starter_app/config/environment.rb:11 from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require' from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in' from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require' from /opt/local/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/commands/server.rb:84 from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from script/server:3
Don't know what happened lately, not because of Rails 2.3.4 for sure. Sherlock? =) I tested to install mysql gem 2.7.0 and 2.8.1, but the funny part is that I don't even use MySQL in my app so this should not even be a problem in the first place?
Comments
-
I receive the following on every page load although the page does actually render and the footnotes display.
Footnotes Footnotes::Notes::SessionNoteNote Exception: undefined method `symbolize_keys' for #<CGI::Session:0x24c3a54>
I'm running Rails 2.3.4
Comments












Hey jqr, I don't notice suck memory leak on my machine. If something is leaking, is probably one note in special. Do you mind remove notes, one by one, until you remove the one that is leaking?
Oh, the only reason I can think is the log note that might be loading the whole log into memory. Do you mind cleaning up your log and checking if the "leak" still exists?
Clearing my log files fixed the issue, so it does seem to be the log note. Maybe we should wrap the log methods with something that additionally outputs to the page instead of loading the entire file.
Previous footnotes versions used
tail, but that didn't work with Windows. Unfortunately Ruby File class does not have a tail method. Have you seen any implementation for this hanging around?i dunno how active the issue is but
http://flori.github.com/file-tail/
does seem that it would make sense to have a windows and non windows version.