Linked Questions

204 votes
11 answers
292k views

Interviewer asked me about this today ...is there an answer ?
Andrew Collins's user avatar
127 votes
17 answers
171k views

In my experience it seems that most people will tell you that it is unwise to force a garbage collection but in some cases where you are working with large objects that don't always get collected in ...
Echostorm's user avatar
  • 9,812
74 votes
4 answers
38k views

I am trying to migrate a database where images were stored in the database to a record in the database pointing at a file on the hard drive. I was trying to use Parallel.ForEach to speed up the ...
Scott Chamberlain's user avatar
34 votes
11 answers
119k views

I'm sorry if this is an obvious question but neither Google or a search here led me to an answer. Is there a way to remove an array entirely? I want the opposite of int[] array = new int[5]
Patrik Björklund's user avatar
20 votes
4 answers
24k views

Is it possible to run .NET garbage collector from command line, e.g. without writing code? Edit: When asked this question, I meant exactly what asked here for Java garbage collector: How to request ...
Kamarey's user avatar
  • 11.1k
14 votes
6 answers
35k views

How do I get the Process ID from a running object? Dim xlApp As Object = CreateObject("Excel.Application") I need to use late binding because I can't guarantee which version I will get so using ...
D_Bester's user avatar
  • 5,991
8 votes
9 answers
4k views

I want to know what action is performed when we call Dispose() method. Is Object frees all resources quickly on Dispose() call or Dispose() marks the Object is ready for garbage collection. And What ...
S K's user avatar
  • 135
2 votes
4 answers
5k views

Is there any way to get GC.Collect() to be called before throwing an OutOfMemoryException? I suppose I'm looking for a way for it to do the following code flow: Try to Allocate Memory On Pass Return ...
Seph's user avatar
  • 8,721
4 votes
2 answers
8k views

I am downloading a lot of data in a loop but after some operations I remove them but what I see is that memory allocation is growing really fast, few seconds and 1GB, so how can clean after each ...
kosnkov's user avatar
  • 5,987
1 vote
6 answers
1k views

I've been thinking if there's a way how to speed up freeing memory in .NET. I'm creating a game in .NET (only managed code) where no significant graphics is needed but still I would like to write it ...
MartyIX's user avatar
  • 28.8k
4 votes
3 answers
2k views

I've seen a lot of articles and questions about how to be sure that Excel actually quits when you want it to and the process doesn't stay alive. Here is a knowledge Base article describing the problem ...
D_Bester's user avatar
  • 5,991
1 vote
3 answers
7k views

i m trying to get excel sheet-name of a excel file from vb.net 3.5 however it opens but excel.exe still remains in the process. How do i stop the process without killing the excel.exe from task ...
sam_33's user avatar
  • 595
4 votes
1 answer
3k views

I have a C# console program. When it runs, it instantiates some Excel objects such as: (openExcelO). When the program is done running, I have a method to close down Excel (closeExcel) and that is ...
Patrick White's user avatar
3 votes
3 answers
1k views

I found this code online that is appended after deinitializing Excel Interop objects: GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); GC.WaitForPendingFinalizers(); Is this quasi-violation ...
B. Clay Shannon-B. Crow Raven's user avatar
0 votes
4 answers
2k views

How can I force a shrink of a DataTable and/or List so that I can free memory efficiently? I am currently removing the processed row from the DataSet every iteration of the loop, but I'm not sure if ...
AndrewJacksonZA's user avatar

15 30 50 per page