I am using a multilingual text box in C # to log some trace information. I just need to add the line as the I have run this program for a few days (with a lot of active trace) and I saw that it was using very much memory, short story short, it appears that the maximum outstanding value ( 256) is expanded with the extension of the contents of the text box. I thought it works like a FIFO (throwing oldest text is more than the maximum length size). Not so, it just keeps on growing in size. This is apparently the reason for my collection of waste. Anybody know what I am doing wrong? Added a few hours after the initial question ... Okay, I tried the code suggested below. To test it quickly, I just add the timer to my app and that timer, now I call a method which essentially does the same thing as the code below, so the tick rate is high so that the process I can see the memory usage and can quickly determine whether there is leakage. There was not that was nice; However, I put it in my application and there was no change in memory usage (still leaking). It is sure that I think that there is a leak somwehere and :-( However, if I just add a return on top of that method, the usage goes back to stabilize. Any ideas on this? Timer Tic-accumulated memory Does not, but my real code (the same way) does. The difference is that I am calling the method from many different places in the actual code. Can this affect somehow in the context of the call? (Note, if this Is not already clear, I am not a .NET specialist in any way) ... appendex (using "text-goes \ r \ n") .
Comments
Post a Comment