Skip to content

Instantly share code, notes, and snippets.

@Pistos
Created February 25, 2013 05:23
Show Gist options
  • Save Pistos/5027933 to your computer and use it in GitHub Desktop.
Save Pistos/5027933 to your computer and use it in GitHub Desktop.
RDBI memory leak
require 'rdbi'
require 'rdbi-driver-postgresql'
dbh = RDBI.connect(:PostgreSQL, host: 'localhost', database: 'any_database', username: 'someusername')
while 1 < 2
puts `ps aux | grep #{Process.pid} | grep -v grep`
1000.times do
dbh.execute "SELECT 1"
end
end
@pilcrow
Copy link

pilcrow commented Feb 26, 2013

puts `ps -o user,pid,%cpu,%mem,vsize,rss,comm #{$$}` # grep?  what's that? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment