i have found the line which is causing out of memory error.
please find the below program and it working similar my application.
/// Summary description for Class1.
public void show(Object O)
Console.WriteLine("Welcome to C#", "TestClass1 Object");
public void show(Object O)
Console.WriteLine("Welcome to ThreadPool", "TestClass2 Object");
static int CountDown= 20;
public static void WaitToShow(Object Obj, bool signaled)
if (Obj != null)
/// The main entry point for the application.
static void Main(string args)
// TODO: Add code to start application here
//AutoResetEvent MyEvent = new AutoResetEvent(false);
ManualResetEvent MyEvent = new ManualResetEvent(false);
testclass t1 = new testclass();
testclass1 t2 = new testclass1();
ThreadPool.RegisterWaitForSingleObject(MyEvent, new WaitOrTimerCallback(Example.WaitToShow),t1,40,false);
In the above example program, i commented the line " MyEvent.Set();" and doesn't gave me out of memory error. but if i didn't comment it then the appliaction getting crashed.
Actually i need to set manualresetevent, since the performance is very good.
please suggest me any solution for how to avoid increasing memory when i set manualresetevent.
Unfortunately on the server side, in ASP.NET, you can't tell the file size before the request is fully uploaded to the server, because the ASP.NET pipeline is invoked only at that time. When a file is greater than 10 MB (default), the request is killed by the ASP.NET runtime.
I am not aware of any client-side method available for determining the file size, unless you want to use Flash.
I can not find any related information from MSDN about the thread safety of this method.
Not directly, but it can be worked out from the documentation.
Console.WriteLine is a wrapper for Console.Out.WriteLine. Console.Out is an instance of a TextReader, and in the documentation for TextReader it says: "Thread Safety Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe."
I am using ICSharpCode.SharpZipLib.FastZip to unzip files we receive over the internet in C#.NET2. The problem I am having is that some of the zipped files we receive contains folders with the files we want in those folders. What I need is for it to unzip the files in the zipped folder directly to the 'target directory'.
Hello i am working with a chat in c# and there´s one thing left to do, a list of members who are in the chat, in a listbox. tried for hours but i am not comming anywhere so now i am asking for help.. so please can some one help me //Bobbziz
Hey i trying to make a application thats run on background and write to a file how long user was running a application
if user click on word then write to a file user clict on word time: 11:01 or somthing like that.
and if user clickt on internet explorer then write to file user clickt on internet explorer time: 11-03.