# RoR on windows with MS SQL Server DBI:ADO driver Memory Leak

**URL:** <https://www.ruby-forum.com/t/ror-on-windows-with-ms-sql-server-dbi-ado-driver-memory-leak/113734>\
**Category:** Rails\
**Created:** [September 4, 2007, 1:58pm UTC](https://www.ruby-forum.com/t/ror-on-windows-with-ms-sql-server-dbi-ado-driver-memory-leak/113734 "2007-09-04T13:58:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![neongrau](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/34f0e0/32.png) [@neongrau](https://www.ruby-forum.com/u/neongrau)\
**Post date:** [September 4, 2007, 1:58pm UTC](https://www.ruby-forum.com/t/ror-on-windows-with-ms-sql-server-dbi-ado-driver-memory-leak/113734/1 "2007-09-04T13:58:00Z")

</div>

i’m running ruby 1.8.5 and rails 1.2.3 on windows with a bunch of  
mongrels that are proxybalanced via apache 2.2.4

the db adapter i’m using is the sqlserver one in ADO mode. so it’s using  
win32ole.

when a mongrel service is freshly started it consumes about 40 megs of  
ram. but about each and every request is leaking memory. about 20 megs  
per hour(!!!).

so after half a day the mongrel processes are at 300 meg each and the  
server barely responds at all.

at first i thought i have a bad memory leak in my app code but when i  
switch the mode to odbc they will stay very stable at 40-41 megs without  
any noticable changes.

the problem is i’m accessing a legacy database with tables still in use  
by an IIS driven classic asp webapp that has data in windows-1252  
encoding while the rails app itself is completely using UTF-8 for it’s  
newer own tables. and to properly read the legacy table data i set

WIN32OLE.codepage = WIN32OLE::CP\_UTF8

which enabled me to read the old tables properly.

with the odbc driver this doesn’t work because it’s not using win32ole.

is there any way to fix that memory leak without switching to odbc and  
manually Iconv’erting all data from the old tables?
