mysql gem memory leak

A

Aaron Starr

I have a tiny script that just opens a database connection and then
repeats:
1) do a query and free the response, and
2) sleep for a few seconds.

Note that this is not using ActiveRecord or any other Rails bits, but
just the straight ruby-mysql bindings. Also note that in this particular
test, the response is always empty; there are no records that match the
query.

The application memory increases over time, so that within a few hours,
it's consuming hundreds of Mb. Anyone else seen this? Is it a version
problem?

Thanks,

Aaron


Versions:

ruby 1.8.7 (2009-04-08 patchlevel 160) [x86_64-linux]

*** LOCAL GEMS ***
mysql (2.7)

Linux version 2.6.24-23-xen (buildd@crested) (gcc version 4.2.3 (Ubuntu
4.2.3-2ubuntu7)) #1 SMP Mon Jan 26 03:09:12 UTC 2009

mysql Server version 5.0.51a-3ubuntu5.4
 
R

Roger Pack

Versions:
ruby 1.8.7 (2009-04-08 patchlevel 160) [x86_64-linux]

*** LOCAL GEMS ***
mysql (2.7)

Linux version 2.6.24-23-xen (buildd@crested) (gcc version 4.2.3 (Ubuntu
4.2.3-2ubuntu7)) #1 SMP Mon Jan 26 03:09:12 UTC 2009

I haven't seen that particular problem before. You could try a newer
version of the gem [2.8.1] or mysqlplus, or the MBARI patches of Ruby,
or try running it with valgrind [you may have found a real leak].
Cheers!
-=r
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,147
Latest member
CarenSchni
Top