Click here to Skip to main content
15,893,161 members
Home / Discussions / C#
   

C#

 
GeneralRe: Help required in Threading.. Pin
harold aptroot1-Jun-10 3:24
harold aptroot1-Jun-10 3:24 
GeneralRe: Help required in Threading.. Pin
Luc Pattyn1-Jun-10 3:51
sitebuilderLuc Pattyn1-Jun-10 3:51 
Questionremote debugging? Pin
swjam31-May-10 20:01
swjam31-May-10 20:01 
AnswerRe: remote debugging? Pin
Abhinav S31-May-10 20:49
Abhinav S31-May-10 20:49 
QuestionC# 2.0 Windows Service - Memory Leak? [modified] Pin
SarahMcM31-May-10 18:08
SarahMcM31-May-10 18:08 
AnswerRe: C# 2.0 Windows Service - Memory Leak? Pin
Pete O'Hanlon31-May-10 21:42
mvePete O'Hanlon31-May-10 21:42 
GeneralRe: C# 2.0 Windows Service - Memory Leak? Pin
SarahMcM1-Jun-10 12:22
SarahMcM1-Jun-10 12:22 
AnswerRe: C# 2.0 Windows Service - Memory Leak? Pin
#realJSOP1-Jun-10 0:06
mve#realJSOP1-Jun-10 0:06 
If you want to make it easier on yourself for debugging, move the code into a separate assembly, and debug it from a console app. That's the way I develop windows services. Once I've got the core code working correctly, I then write the service assembly itself that references the core code assembly, and anything that goes wrong at that point is the fault of the service code itself.

As to your problem, I don't use the Timer objects. I prefer to set up a thread that does the timer work, and another thread that performs the actual work. This way, you can see if the worker thread is busy and if so, you can just ignore the request to write the log file (or even queue it up for processing later).

If you want to save some processing time, retrieve your settings just one time, which brings to the forefront your AppSettingsReader object. Could that be one of the the sources of your memory leak?

Lastly, if an object you're creating has a Dispose method (like the Timer objects do), call it before setting the object to null.
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

GeneralRe: C# 2.0 Windows Service - Memory Leak? Pin
SarahMcM1-Jun-10 12:21
SarahMcM1-Jun-10 12:21 
AnswerRe: C# 2.0 Windows Service - Memory Leak? Pin
PIEBALDconsult1-Jun-10 4:03
mvePIEBALDconsult1-Jun-10 4:03 
GeneralRe: C# 2.0 Windows Service - Memory Leak? Pin
SarahMcM1-Jun-10 12:13
SarahMcM1-Jun-10 12:13 
AnswerRe: C# 2.0 Windows Service - Memory Leak? Pin
SarahMcM1-Jun-10 15:19
SarahMcM1-Jun-10 15:19 
Questionhow about erasing trace of Rectangle? [modified] Pin
sonic74731-May-10 17:59
sonic74731-May-10 17:59 
AnswerRe: how about erasing trace of Rectangle? Pin
Stanciu Vlad31-May-10 21:53
Stanciu Vlad31-May-10 21:53 
GeneralRe: how about erasing trace of Rectangle? Pin
sonic74731-May-10 23:51
sonic74731-May-10 23:51 
GeneralRe: how about erasing trace of Rectangle? Pin
Stanciu Vlad1-Jun-10 0:37
Stanciu Vlad1-Jun-10 0:37 
AnswerRe: how about erasing trace of Rectangle? Pin
Pete O'Hanlon1-Jun-10 1:02
mvePete O'Hanlon1-Jun-10 1:02 
GeneralRe: how about erasing trace of Rectangle? Pin
sonic7471-Jun-10 2:12
sonic7471-Jun-10 2:12 
GeneralRe: how about erasing trace of Rectangle? Pin
Pete O'Hanlon1-Jun-10 2:37
mvePete O'Hanlon1-Jun-10 2:37 
QuestionUnhandled exception in the designer (OnPaint) Pin
AussieLew31-May-10 13:18
AussieLew31-May-10 13:18 
AnswerRe: Unhandled exception in the designer (OnPaint) Pin
Luc Pattyn31-May-10 13:30
sitebuilderLuc Pattyn31-May-10 13:30 
AnswerRe: Unhandled exception in the designer (OnPaint) Pin
Stanciu Vlad31-May-10 21:57
Stanciu Vlad31-May-10 21:57 
QuestionSerial interface RS-232 C# app data recive issue Pin
sebogawa31-May-10 9:32
sebogawa31-May-10 9:32 
AnswerRe: Serial interface RS-232 C# app data recive issue Pin
Luc Pattyn31-May-10 9:53
sitebuilderLuc Pattyn31-May-10 9:53 
AnswerRe: Serial interface RS-232 C# app data recive issue Pin
Richard Andrew x6431-May-10 11:14
professionalRichard Andrew x6431-May-10 11:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.