.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Imran Ghani
Post New Web Links

Windows Service .NET running on CLR 4.0 High CPU Usage

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :WPF
 

We have a windows service which hosts different appdomains. This processes uses remoting over IPC and TCP to communicate across the different app domains and with other processes.

 

This process is compiled using .NET framework 2.0 (vs2005) but we forced it to run on CLR 4.0 using the following entry in the config file.

  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0"/>
  </startup>

 

The problem is that after some hours of running, the process starts eating up the CPU cycles. When debugging with WINDBG we notice that the thread consuming much of the CPU is in fact the Garbage Collector (<gcServer> is set to true).

 

On inspection of the Heap we notice that there is a very huge array on the LOH of the type System.LocalDataStoreElement with around 18million entries all set to null. This array is copied and increased each time, which is what is causing the cpu issue.

Now in our services we are passing Identities to impersonate user in the other appdomains / processes in the Named dataslots for the different threads (we have an object which implements the ILogicalThreadAffinative).

 

This issue is not present if the process runs on the CLR 2.0. Anybody can shed to us som


View Complete Post


More Related Resource Links

Windows Service running on W2K3 but not working on W2K8 R2

  

I do have a bunch of windows services (written in C#) that all use the same pattern - there's a class library which has a public Start and Stop method - and those methods are called by my service wrapper at the appropriate point in time. The class lib also has a main method and can run as standalone software - it's just a project configuration switch to decide if I want the actual program logic as a dll or an exe.

So far so good - in recent days I made some changed to one of my services that had been running just fine on dozens of machines. When I wanted to upgrade though, I ran into some issues. My staging box is a W2K3 R2 box, and there I had no trouble running the newly compiled service (the service .exe file was left.. but dll was changed). Then I went to our production machines which use W2K8 R2, and then the following happend:

The service controller reports that the service cannot be started. In the Event Viewer, I see an event 7009 ("A timeout was reached (30000 milliseconds) while waiting for the xyz service to connect"), then followed by an event 7000 ("The xyz service failed to start due to the following error: The service did not respond to the start or control request in a timely fashion").

I then went ahead and changed the output type of my dll project to commandline, added the exe to the path where the service resid

High memory usage by the SSMS.exe and no Running Query

  

Hi i am editing a stored procedure using the SSMS (I have SQL Server 2008 SP1 - Windows 2003 Server Standard). At the begining everything is ok, but around of 3 or 4 minutes of work the ssms is becoming to slow, I open the Task Manager and I see that the process SSMS.exe is using 1.2GB of RAM Memory. I have open just one script (The stored procedure that I'm editing) but the script isnt running only editing. I dont understand that high memory because i'm not retreiving data of any query and im not running any thing on my ssms. Take a look of my task manager http://i875.photobucket.com/albums/ab319/jacarmonaro/highMemory.jpg

Other thing: When I minimize the ssms window the smss.exe process come back to a normal RAM memory usage.

Please any help??

 


JAC

High memory usage by the SSMS.exe and no Running Query

  

Hi i am editing a stored procedure using the SSMS (I have SQL Server 2008 SP1 - Windows 2003 Server Standard). At the begining everything is ok, but around of 3 or 4 minutes of work the ssms is becoming to slow, I open the Task Manager and I see that the process SSMS.exe is using 1.2GB of RAM Memory. I have open just one script (The stored procedure that I'm editing) but the script isnt running only editing. I dont understand that high memory because i'm not retreiving data of any query and im not running any thing on my ssms. Take a look of my task manager http://i875.photobucket.com/albums/ab319/jacarmonaro/highMemory.jpg

Other thing: When I minimize the ssms window the smss.exe process come back to a normal RAM memory usage.

Please any help??

 


JAC

SQL Server 2000 is getting very slow, memory usage also very high but restarted db service it comes

  

Hi,

I am facing slow down problem in SQL Server 2000. SQL Server is very very slow during that time memory also very high usage but when I restart SQL Service it comes to normal. Please advice, if anyone who has experienced in this type of situation. Appreciate if you help to resolve this problem. Thanks

 

S.Jay

 


Mikha

Windows Server Backup fails when SQL VSS Writer service is running

  

Hello. On one of our SQL servers, we have SQL Server 2008 Express installed. Whenever is the "SQL Server VSS Driver" service running, backing up the computer with Windows Server Backup will always fail. If I stop SQL VSS writer service, then it the backup will finish successfully, although apparently backup of the SQL DBs is not consistent.

Details:

- backup is executed with "wbadmin start backup -allcritical -backuptarget:d: -vssfull -quiet"

- root of the SQL Server instance (and all DBs, trans. logs etc) are located on a volume E:

- once the backup command is executed, it's stuck on the creating volume shadow copies operation for several minutes, failing afterwards

- SQL VSS Writer has status 8 (failed), last error is "non-retryable"

- eventlog contains myriad of messages since the backup is started (SQL server has hundreds of DBs on it), with variations of these 3 repeating:

  a) SQLVDI: Loc=TriggerAbort. Desc=invoked. ErrorCode=(0). Process=1304. Thread=15788. Server. Instance=SQLEXPRESS. VD=Global\{A4C1E365-459A-4D41-B3D0-1A76DB8E56F6}517_SQLVDIMemoryName_0. Source: SQLVDI, EventID: 1. This is repeated numerous times, where thread id varies and number (517 in this case) in the VD identifier

  b) BACKUP failed to complete the command BACKUP DATABASE

Cant move system databases of SQL Server 2008 (Clustered) running in Windows 2008 with Service SID e

  

Hi,

I was trying to move system databases of SQL Server 2008 on clustered emvironment running on Windows 2008.

I remember while doing the cluster installation somewhere it gave me a recomended option of using Service SID. I think that is the culprit here. Because if you see the "Security" of the DATA folder containing all the MDF and LDF (by default location) you will find a Group named "MSSQLSERVER" is having full access to that directory.

While moving the system databases you need that account (MSSQLSERVER) given access to the parent directory containing the MDF and the LDFs, But unfortunately you cannot add that account manually. Even I tried XCOPY to make sure that while copying the ACLs gets transferred properly to the destination, even that failed.

I think it does provide a solid Security but at the expense of Maintenance, which I cant agree.

Also I forgot to tell you that this Sevice SID option is available if you are using Windows Vista / Windows 2008 or above,

Does anyone has any experience of moving the system databases with Service SID enabled in a cluster environment.

As a testing just try to copy/xcopy/robocopy any folder having MSSQLSERVER group in the ACL and see what happens .. If you are lucky like me then you will get ACCESS DENIED error.

Have anyone faced the same error? I h

Windows Service Applications Tutorials

  
You can easily create services by creating an application that is installed as a service. For example, suppose you want to monitor performance counter data and react to threshold values. You could write a Windows Service application that listens to the performance counter data, deploy the application, and begin collecting and analyzing data.

Cloud Computing: Patterns For High Availability, Scalability, And Computing Power With Windows Azure

  

Here we examine the typical cloud platform architecture and some common architectural patterns, along with their implementation on the Windows Azure offering from Microsoft.

Joshy Joseph

MSDN Magazine May 2009


Windows with C++: Exploring High-Performance Algorithms

  

See how you can gain efficiency in surprising ways by looking closely at your algorithms, the data they operate on, and the hardware you're designing for.

Kenny Kerr

MSDN Magazine October 2008


Web Service Workflows: Deploy Distributed Business Processes With Windows Workflow And Web Services

  

Due to the distributed nature of a business process it makes sense for a workflow to be deployed as a distributed application. See how Windows Workflow and Web Services hold the key.

Israel Hilerio

MSDN Magazine October 2006


Service Station: Serialization in Windows Communication Foundation

  

Windows Communication Foundation supports several serialization mechanisms and provides a simple, interoperable foundation for future service-oriented applications. Here Aaron Skonnard explains it all.

Aaron Skonnard

MSDN Magazine August 2006


High Availability: Keep Your Code Running with the Reliability Features of the .NET Framework

  

Reliability requires the capacity to execute a sequence of operations in a deterministic way, even under exceptional conditions. This allows you to ensure that resources are not leaked and that you can maintain state consistency without relying on application domain unloading (or worse, process restarts) to fix any corrupted state. Unfortunately, in the.NET Framework, not all exceptions are deterministic and synchronous, which makes it difficult to write code that is always deterministic in its ability to execute a predetermined sequence of operations. In this article Stephen Toub will show you why, and explore features of the .NET Framework 2.0 that help you to mitigate these situations and write more reliable code.

Stephen Toub

MSDN Magazine October 2005


Timers: Implement a Continuously Updating, High-Resolution Time Provider for Windows

  

The timestamps that you can obtain from Windows NT are limited to a maximum resolution of 10 or 15 milliseconds, depending on the underlying hardware. At times, such as when you need to timetag frequent events, it is desirable to achieve a higher resolution. For example, what if you want to be able to contact a thread or perform some other task at intervals more frequent than 10 milliseconds? Suggested ways of achieving better resolution include using performance counters in conjunction with the sytem time to calculate smaller time increments. But using performance counters is a technique that presents its own problems. This article shows one possible way of overcoming limitations inherent in this approach.

Johan Nilsson

MSDN Magazine March 2004


Windows Services: New Base Classes in .NET Make Writing a Windows Service Easy

  

Windows services are applications that run outside of any particular user context in Windows NT, Windows 2000, or Windows XP. The creation of services used to require expert coding skills and generally required C or C++. Visual Studio .NET now makes it easy for you to create a Windows service, whether you're writing code in C++, C#, or Visual Basic. You can also write a Windows service in any other language that targets the common language runtime. This article walks you through the creation of a useful Windows service, then demonstrates how to install, test, and debug the service.

Ken Getz

MSDN Magazine December 2001


Develop a Web Service: Up and Running with the SOAP Toolkit for Visual Studio

  

The new Simple Object Access Protocol (SOAP) Toolkit for Visual Studio 6.0 provides the infrastructure for developers to build, expose, and consume Web services. With a few exceptions that are outlined in the toolkit, the SOAP Toolkit complies with the SOAP version 1.1 specification. It includes the Remote Object Proxy Engine (ROPE), a Service Description and Code Generation Wizard, and code that provides ASP and ISAPI reference implementations of SOAP listeners. This article describes the tools and the object model of the SOAP Toolkit, and then demonstrates ASP and ISAPI implementations of a functional Web service using this toolkit.

Rob Caron

MSDN Magazine August 2000


Video: Coding a Long-Running Operation Page in SharePoint Server 2007 or Windows SharePoint Services

  
Watch this visual how-to video as you learn to write code to mimic the default long-running operations page (the "spinning wheel") in SharePoint Server 2007 or Windows SharePoint Services 3.0. (Length: 7:56)

Coding a Long-Running Operation Page in SharePoint Server 2007 or Windows SharePoint Services 3.0 (V

  
Watch the video and explore code as you learn how to write code to mimic the default long-running operations page (the "spinning wheel") in SharePoint Server 2007 or Windows SharePoint Services 3.0.
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend