Memory
-
I have a Windows Service running in the same server as SQL Server. This service uses lot of resources (basically memory). The problem is that at some point, SQL Server uses almost all the available memory in my server. The service runs a memory intensive process from time to time, and I constantly receive an "OutOfMemory" exception (sql server is not leaving much available memory for my service to do its tasks). My service needs about 20MB of free memory, and my question is: Is there any way to pre-alocate this amounth of memory to my service. I mean... not really "allocate" the memory, but "reserve" the memory. Maurício Ritter Mauricio Ritter - Brazil MSN: mauricioritter(atsign)hotmail.com
English is not my native language so, if you find any spelling erros in my posts, please let me know. -
I have a Windows Service running in the same server as SQL Server. This service uses lot of resources (basically memory). The problem is that at some point, SQL Server uses almost all the available memory in my server. The service runs a memory intensive process from time to time, and I constantly receive an "OutOfMemory" exception (sql server is not leaving much available memory for my service to do its tasks). My service needs about 20MB of free memory, and my question is: Is there any way to pre-alocate this amounth of memory to my service. I mean... not really "allocate" the memory, but "reserve" the memory. Maurício Ritter Mauricio Ritter - Brazil MSN: mauricioritter(atsign)hotmail.com
English is not my native language so, if you find any spelling erros in my posts, please let me know.There is a spelling error in your spelling error disclaimer. It is "errors" not "erros" (eros? :D) SCNR ;)
-
I have a Windows Service running in the same server as SQL Server. This service uses lot of resources (basically memory). The problem is that at some point, SQL Server uses almost all the available memory in my server. The service runs a memory intensive process from time to time, and I constantly receive an "OutOfMemory" exception (sql server is not leaving much available memory for my service to do its tasks). My service needs about 20MB of free memory, and my question is: Is there any way to pre-alocate this amounth of memory to my service. I mean... not really "allocate" the memory, but "reserve" the memory. Maurício Ritter Mauricio Ritter - Brazil MSN: mauricioritter(atsign)hotmail.com
English is not my native language so, if you find any spelling erros in my posts, please let me know.And now for something useful: Basically, .NET takes Memory Management out of your hands (GC-wise), so you can simply hack away. If I was you, I wouldnt want to lose that ability. I am not sure about .NET, but in Suns JAVA-VM you can specify how much memory you need and the Runtime would then reserve it. This is one way you could go (that is, IF .NET has similar functionality). The other way would be limiting the SQL-Server to a certain amount of memory (if possible). The third (and slowest way) would be try/catching each memory-affection operation and then retrying (with a 20ms sleep, maybe) until you get your operation completed (I understand that the memory-consuming allocations of the SQL-Server are peaks only). There may be more solutions, but the above are all I can think of. Before I forget, there also are 2 non-programmatical solutions to your problem: 1st - let Windows handle the page file or set it to something bigger (e.g. 1 GB) 2nd - upgrade your server (more physical RAM) Cheers Sid
-
I have a Windows Service running in the same server as SQL Server. This service uses lot of resources (basically memory). The problem is that at some point, SQL Server uses almost all the available memory in my server. The service runs a memory intensive process from time to time, and I constantly receive an "OutOfMemory" exception (sql server is not leaving much available memory for my service to do its tasks). My service needs about 20MB of free memory, and my question is: Is there any way to pre-alocate this amounth of memory to my service. I mean... not really "allocate" the memory, but "reserve" the memory. Maurício Ritter Mauricio Ritter - Brazil MSN: mauricioritter(atsign)hotmail.com
English is not my native language so, if you find any spelling erros in my posts, please let me know.You can set SQL server to a maximum memory usage, otherwise it just uses memory until the server starts paging. Increasing the page file should fix the problem as well, but then you would be causing the server to page which is a bad thing for performance. Better would be to move your process off the SQL server, or find a different algorithm.
I can imagine the sinking feeling one would have after ordering my book, only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon