473,779 Members | 2,062 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Windows service “Mem Usage” in the task manager.

Hi,
I have a windows service, which is currently installed, on my local computer.
The problem is that when I look at the task manager, I see that the “Mem
Usage”, become bigger and bigger.
Has someone any idea why this happens?
Anyway to solve this problem I thought to stop the service and start it
programmaticall y when it’s “Mem Usage” is too big.
Is it possible?

Jul 11 '06 #1
4 3355
I forgot to write that my windows service call a web service.

"Niron kag" wrote:
Hi,
I have a windows service, which is currently installed, on my local computer.
The problem is that when I look at the task manager, I see that the “Mem
Usage”, become bigger and bigger.
Has someone any idea why this happens?
Anyway to solve this problem I thought to stop the service and start it
programmaticall y when it’s “Mem Usage” is too big.
Is it possible?
Jul 11 '06 #2
"Niron kag" <Ni******@discu ssions.microsof t.comwrote in message
news:F9******** *************** ***********@mic rosoft.com...
Hi,
I have a windows service, which is currently installed, on my local
computer.
The problem is that when I look at the task manager, I see that the "Mem
Usage", become bigger and bigger.
Has someone any idea why this happens?
Anyway to solve this problem I thought to stop the service and start it
programmaticall y when it's "Mem Usage" is too big.
Is it possible?
You have a memory leak somewhere. Put a GC.Collect in a timer as a test to
make sure it's not just the garbage collector making the size larger. If
you've still got the memory leak then you need to track down where it is
coming from. If it's coming from your code, which is most likely, then you
just need to fix your code to eliminate the leak. Look for places where you
might leave objects alive. If it's from someone elses code then you'll have
more troubles but there's usually ways to solve that too.

Michael
Jul 11 '06 #3
Use performance counter to find the leak.

Process/Virtual Bytes
Process/Private Bytes
.net CLR Memory/# Bytes in all Heaps
.net CLR Memory/% Time in GC
.net CLR Memory/Large Object Heap size
.net CLR Loading/Bytes in Loader Heap
.net CLR Loading/Current Assemblies
if the private bytes keep increasing but # Bytes in all Heaps do not, you’re
likely looking at a native memory leak, but if # Bytes in all heaps increase
at the same rate as private bytes your leak is likely in managed code.

if you see a steady increase of virtual bytes but your private bytes stay
pretty steady, your application probably has a problem where it is reserving
a lot of virtual memory that it’s not using.

Bytes in Loader Heap and Current Assemblies should stay fairly constant once
the process has started up and all app domains are loaded. If this keeps
continuously increasing it is very probable that you have an assembly leak

"Niron kag" wrote:
Hi,
I have a windows service, which is currently installed, on my local computer.
The problem is that when I look at the task manager, I see that the “Mem
Usage”, become bigger and bigger.
Has someone any idea why this happens?
Anyway to solve this problem I thought to stop the service and start it
programmaticall y when it’s “Mem Usage” is too big.
Is it possible?
--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Jul 11 '06 #4
You can consider using a memory profiler
If using a memory profiler - take the snapshot after the windows
service has completed atlest 1 or 2 iterations of what it is doing(
this way you take the initial snapshot once all the cache is
initialized), and then take a snapshot again once the service has
completed 1 or 2 more iterations.
Do a diff of the two snapshots( the memory profiler will give you tools
for that).
And you can see the objects which are growing in the memory and
possibly the methods which are creating them.

Pranshu

Jul 11 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1368
by: Juan Manuel Alegra B. | last post by:
Hi group, I've sent this question in other group.... How can I see my Windows service application on the task manager. Thanks so much. Guadalajara, Mexico.
2
2772
by: Russ McDaniel | last post by:
Originally posted to microsoft.public.dotnet.distributed_apps with no response. Reposted here with additional thoughts. --- Hello, I'm writing a Windows service which performs some potentially long-running, uninterruptable processes. When the service starts, I create a separate worker thread to perform the work so as to not block the service control manager upon startup. The design quandry I'm running into though is how best
0
3404
by: Ross Bennett | last post by:
Ahoy, Folks! I've been looking all over for this, but I just can't seem to shake any documentation out of the MSDN or from Google. I've reviewed every .NET article on developing Windows Services in the MSDN I've located. I'm developing a Windows Service application. This service reads its configuration data from the system registry (HKLM) where it was deposited by another "manager" application. No problems there.
2
21913
by: Mark | last post by:
I created an extremely simple windows service that only writes to the EventLogs on Stop and Pause. I installed it using the InstallUtil.exe program, the output of which is below. It appears to be successful. I'm now ready to start my service (I think) but the NET START command does not appear to indicate that the service is available to be run. The output for NET START is below as well. The Services list in the W2K administrator...
7
3863
by: Steve Long | last post by:
In writing a Windows service with .NET, I'm noticing that the process for some services can not be killed with specifically stopping the service. If you try to kill the process with, say task manager, you get an access denied message. I just wrote a test service and I can kill the process for this service without actually stopping the service. Can someone tell me how to keep the process for my service from being killed without actually...
4
9025
by: Kris | last post by:
I have a Windows Service in C# talking to a serial port and using Remoting. It also uses several COM objects. On customer's computer the service will occassionally hang somewhere - the service still shows on a Task Manager list. In Services it says it is still running. However there is no way to stop it other than by rebooting the whole computer. No exception (including non-CLS) is ever generated. I added a separate System.Timers.Timer...
3
1502
by: leo_junquera | last post by:
I am trying to use windows authentication on an intranet to call a web service. When I make my first call to the service after connecting from a client app using: ws.Url = ServiceUrl; ws.Credentials = System.Net.CredentialCache.DefaultCredentials; ws.UnsafeAuthenticatedConnectionSharing = true; It takes forever (2-3 minutes) and my mem usage for aspnet_wp.exe balloons from 2,952K to 586,264K and stays there.
3
1327
by: gb | last post by:
I have a Windows Service that watches a directory using the FileSystemWatcher. When an Excel spreadsheet gets added to that directory, the Windows Service calls a routine that opens the Excel spreadsheet and does some processing (on a seperate thread). After processing is done on the spreadsheet, it is closed and the reference is set to Nothing. However, if you go to the Task Manager, the Excel process is still there. Each time the Service...
6
239
by: =?Utf-8?B?QW5kcmV3?= | last post by:
Hi, I've created a windows application C# service according to: http://msdn2.microsoft.com/en-us/library/ms123402.aspx?wa=wsignin1.0 But my service is not appearing in the computer management panel at all. Any ideas ? cheers
0
9636
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
10306
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5503
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2869
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.