CLR initialization permanently failed

  • Hi All,

    I'm having a problem with CLR failing on a server and with little CLR development experience I'm not sure where to look next. We have one database on a server hosting many others that is using CLR in a single procedure. When the proc stopped working the other day I found the message "CLR initialization permanently failed" from dm_clr_properties. Most posts I've seen on this indicates memory pressure as the cause of failure, but PerfMon stats show plenty of memory available, average SQL Memory around 10 GB of 64 GB total and spikes of ~48 GB.

    Anyone have other suggestions on how to troubleshoot?

    Thanks,

    Tim

  • Hi Tim

    Could you please give a short description of what your procedure does?

    Thanks

    Flo

  • Tim Peters (9/2/2009)


    Hi All,

    I'm having a problem with CLR failing on a server and with little CLR development experience I'm not sure where to look next. We have one database on a server hosting many others that is using CLR in a single procedure. When the proc stopped working the other day I found the message "CLR initialization permanently failed" from dm_clr_properties. Most posts I've seen on this indicates memory pressure as the cause of failure, but PerfMon stats show plenty of memory available, average SQL Memory around 10 GB of 64 GB total and spikes of ~48 GB.

    Anyone have other suggestions on how to troubleshoot?

    Thanks,

    Tim

    What does your CLR do? The reason I ask is that there's usually a T-SQL method that will rival the CLR for speed with few exceptions.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • I've already agreed with the developers to recode this skipping the CLR as it's a simple date calculation. I'm not sure why they went CLR in the first place. Until they get around to this I've move them off onto a test server. Right now I'm trying to use this as an opportunity to get a little more CLR experience.

    Thanks,

    Tim

  • On 32-bit editions, this is usually caused by a lack of available (contiguous) virtual address space.

    Moving to 64-bit is a good solution - for any one of the many classes of problems which are better tackled in hosted .NET code.

    Paul

  • Tim Peters (9/3/2009)


    I've already agreed with the developers to recode this skipping the CLR as it's a simple date calculation. I'm not sure why they went CLR in the first place. Until they get around to this I've move them off onto a test server. Right now I'm trying to use this as an opportunity to get a little more CLR experience.

    Thanks,

    Tim

    Just one step further, Tim. What is the "simple date calculation"? Heh... and yes, I'm writing a book. 😉

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Thanks guys.

    Paul, it's on 64 bit (OS and SQL) already.

    Jeff, it's a week number calculation. Depending on the day of the week of Jan 1 and how you calculate it there can be 53 weeks in a year. Some people only count the first full week and some count the first partical week. This calculation does one of those to set the week number for the application. I don't remember which way it does it.

    Tim

  • Thanks for the feedback, Tim. When they get it sorted, I'd sure like to know what the method for determining the week was. Not necessarily the SQL... just the rationale behind the method.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply