Skip to content

Instantly share code, notes, and snippets.

@gotascii
Created March 3, 2012 01:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gotascii/1963255 to your computer and use it in GitHub Desktop.
Save gotascii/1963255 to your computer and use it in GitHub Desktop.
irb(main):009:0> GC.enable_stats
=> false
irb(main):013:0> GC.clear_stats
=> nil
irb(main):014:0> n.ar_users.select("id").find_in_batches(:batch_size => 1000) {|u| u }
=> nil
irb(main):015:0> GC.allocated_size
=> 902823508
irb(main):016:0> ObjectSpace.allocated_objects
=> 104920800
irb(main):024:0> GC.clear_stats
=> nil
irb(main):025:0> User.connection.execute("select id, guid from users where network_id = #{n.id}").to_a; 1
=> 1
irb(main):026:0> GC.allocated_size
=> 89633690
irb(main):027:0> ObjectSpace.allocated_objects
=> 118256386
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment