This project is archived and is in readonly mode.

#6130 ✓stale
Rhett Barber

Windows & sqlserver - ActiveRecord::StatementInvalid (NoMemoryError: failed to allocate memory: SELECT

Reported by Rhett Barber | December 7th, 2010 @ 11:59 PM

ActiveRecord::StatementInvalid (NoMemoryError: failed to allocate memory: SELECT

Even for simple 50 item LIMITED-SMALL-ActiveRecord Object queries like this:
NoMemoryError: failed to allocate memory: SELECT TOP (50) [items].* FROM [items])

WORKING FIX:
Convert all ntext fields to text.

Comments and changes to this ticket

  • Rhett Barber

    Rhett Barber December 8th, 2010 @ 12:03 AM

    @items = Item.limit(50).all

  • Rhett Barber

    Rhett Barber December 8th, 2010 @ 12:42 PM

    This happens to queries at random. Sometimes it will let them through, other times it gives this error. I have tried serving with mongrel, thin, rails s. I have tried all the 3.x versions of the activerecord-sqlserver-adapter.

  • Rhett Barber

    Rhett Barber December 8th, 2010 @ 01:15 PM

    Windows 7 Ultimate x64 dual quad with 8gb ram.

  • Rhett Barber
  • Rhett Barber

    Rhett Barber December 8th, 2010 @ 04:12 PM

    Commented out this

    rescue Exception => e

    message = "#{e.class.name}: #{e.message}: #{sql}"

    @logger.debug message if @logger

    raise translate_exception(e, message)

    seems to work somehow. Have not extensively tested.

  • kdgundermann

    kdgundermann December 8th, 2010 @ 09:29 PM

    Are you using the sqlserver adapter with ruby-odbc or with TinyTDS ?

  • Rhett Barber

    Rhett Barber December 8th, 2010 @ 10:42 PM

    http://www.ch-werner.de/rubyodbc/

    It contains the files odbc.so and odbc_utf8.so which need to be copied into the .../ruby/1.8/i386-msvcrt directory of MSVC based Ruby 1.8 installations.

    and

    gem 'rails', '3.0.1'
    gem 'activerecord-sqlserver-adapter' , '3.0.6'

    I BELIEVE COMMENTING OUT THE ABOVE HAS FIXED THIS ISSUE TEMPORARILY, I NEED MORE TIME TO CONFIRM.

  • Rhett Barber

    Rhett Barber December 9th, 2010 @ 09:23 PM

    It is happening again. I will work to narrow the causes.

  • Rhett Barber

    Rhett Barber December 9th, 2010 @ 11:29 PM

    Restarting the computer allows the exact query that failed to execute. Restarting mongrel and closing the command prompt and then restarting mongrel or thin does not help (the exact same query fails-even simple ones).

  • Rhett Barber

    Rhett Barber December 22nd, 2010 @ 11:06 PM

    Convert all ntext fields to text. I knew this before but thought I had already converted all columns. I missed two in this table. I will test thoroughly tomorrow and report status. It works right off.

  • Rhett Barber

    Rhett Barber December 23rd, 2010 @ 08:44 PM

    Still working fine. RAILS 3 IS AWESOME. THANKS RAILS CONTRIBUTORS!! GOD BLESS YOU. MERRY CHRISTMAS.

  • rails

    rails March 30th, 2011 @ 01:00 AM

    • State changed from “new” to “open”

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

  • rails

    rails March 30th, 2011 @ 01:00 AM

    • State changed from “open” to “stale”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Pages