Skip to content

Instantly share code, notes, and snippets.

@vparihar01
Created March 28, 2013 17:56
Show Gist options
  • Save vparihar01/5265402 to your computer and use it in GitHub Desktop.
Save vparihar01/5265402 to your computer and use it in GitHub Desktop.
Small piece of of code to check the memory stats for ruby on rails application, for any particular method.
require 'csv'
def memstats
size = `ps -o size= #{$$}`.strip.to_i
end
memstats
test = CSV.read('test.csv', headers: true)
test.count{|v| v['any_column'] = ~/any_text_in_that_column_to_search/}
memstats
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment