I see some people asked about GC.Collect(), for example:         I see that in general, people say: CG is smart enough to collect garbage on it own, premature optimization is bad.   But according to :     Use this method to try to reclaim all memory that is inaccessible. It   performs a blocking garbage collection of all generations.      All objects, regardless of how long they have been in memory, are   considered for collection; however, objects that are referenced in   managed code are not collected. Use this method to force the system to   try to reclaim the maximum amount of available memory.   So I see that this GC.Collect() command only delete the data that is no longer used, I can't think of any risk that it may cause, so what is the risk of calling GC.Collect()? Is it bad for the PC's hardware?
47244
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 the 0 generation but where memory is an issue, is it ok to force the collect?  Is there a best practice out there for doing so?
57125
I'm writing a game in C++ (with OpenGL) and am getting quite far into development. Currently I'm loading the data directly from different directories.  (E.G. I load textures from a /Data/Textures/...png)  This is fine, but not preferable. Ideally I would like to protect these assets without too much of a performance hit. I looked at other games that I own, both Indie and AAA and found that the majority of them archive the data. However, I am unable to access these archives with programs like Winrar Archiver which implies that they have some level of protection.  I'm not particularly knowledgeable in the field of encryption and data storage, so I may be overlooking something obvious but I would like to know how exactly I could achieve something similar.  (I am aware that competent individuals are able to use the GPU to gain access to the data but that's not preventable)
7171
What does the Recycle Bin in Windows actually do?  Is it just a glorified folder and a holding place for soon to be deleted files, or does it do something specific?  Specifically, are files that are "moved" to the Recycle Bin actually moved on the hard disc, or are just the pointers to the files moved?  I am a fairly experienced user, I just wanted a more depth explanation of the Recycle Bin.
43150
I've been reading through a lot of the rookie Java questions on finalize() and find it kind of bewildering that no one has really made it plain that finalize() is an unreliable way to clean up resources.  I saw someone comment that they use it to clean up Connections, which is really scary since the only way to come as close to a guarantee that a Connection is closed is to implement try (catch) finally.    I was not schooled in CS, but I have been programming in Java professionally for close to a decade now and I have never seen anyone implement finalize() in a production system ever.  This still doesn't mean that it doesn't have its uses, or that people I've worked with have been doing it right.  So my question is, what use cases are there for implementing finalize() that cannot be handled more reliably via another process or syntax within the language?    Please provide specific scenarios or your experience, simply repeating a Java text book, or finalize's intended use is not enough, as is not the intent of this question.
19601
Does anyone have experience with using very large heaps, 12 GB or higher in Java?   Does the GC make the program unusable? What GC params do you use? Which JVM, Sun or BEA would be better suited for this? Which platform, Linux or Windows, performs better under such conditions? In the case of Windows is there any performance difference to be had between 64 bit Vista and XP under such high memory loads?
45531
For example, I rarely need:  using System.Text;   but it's always there by default. I assume the application will use more memory if your code contains unnecessary . But is there anything else I should be aware of?  Also, does it make any difference whatsoever if the same using directive is used in only one file vs. most/all files?    Edit: Note that this question is not about the unrelated concept called a , designed to help one manage resources by ensuring that when an object goes out of scope, its  method is called. See .
2968
Coming from a java background, one of the things I am used to is telling the JVM what the maximum heap size should be.  If the running program tries to swallow more than is allowed, and the garbage collector cannot free any more resources, then OutOfMemoryError is thrown and it all goes bang.  So setting the maximum heap size is important in Java.  Does this apply in .net?  Can you set the heap size limits?  Does the CLR just keep growing its heap until it reaches the machine's physical limits?  Or is it not an issue in .net for some subtle reason that my Java blinkers stop me from seeing?
95046
I'm running badblocks to check for bad segments on an external drive, and it's been about an hour and it has not yet finished. Now, I need to go and consider cancelling. Is this somehow risky? Should I avoid this?   Clearly, I will need to start again from scratch; I just want to know if this is somehow risky to abort midway.
98843
In my initial basic tests it is perfectly safe to do so.  However, it has struck me that attempting to manipulate this later in a function that deletes this could be a runtime error.  Is this true, and is it normally safe to delete this? or are there only certain cases wherein it is safe?
83166
Ok, so when I try to delete this from my desktop, I get this error:    When I click "See what's locking this" in lock hunter, I get this:    Now, I have a drive, called G:. I only have one physical drive, and it's D:. Also, I have NO virtual drive software installed, so I have NO clue how it got there. Right-clicking on G:\ and chosing eject doesn't do anything but change the logo, it still says the file size and whatnot. Here's the picture of the "What's locking this?" of the contained file:    But when I try to delete it...    Both of these files don't let me delete them. I had put win8install.iso as a virtual drive a while back, but I uninstalled that software (but can reinstall it if needed)  Starting this in safe mode doesn't work.
95401
If you are relying on an implementation of Python that has a Global Interpreter Lock (i.e. CPython) and writing multithreaded code, do you really need locks at all?  If the GIL doesn't allow multiple instructions to be executed in parallel, wouldn't shared data be unnecessary to protect?  sorry if this is a dumb question, but it is something I have always wondered about Python on multi-processor/core machines.    same thing would apply to any other language implementation that has a GIL.
76867
Should you set all the objects to null (Nothing in VB.NET) once you have finished with them?   I understand that in .NET it is essential to dispose of any instances of objects that implement the IDisposable interface to release some resources although the object can still be something after it is disposed (hence the isDisposed property in forms), so I assume it can still reside in memory or at least in part?  I also know that when an object goes out of scope it is then marked for collection ready for the next pass of the garbage collector (although this may take time).  So with this in mind will setting it to null speed up the system releasing the memory as it does not have to work out that it is no longer in scope and are they any bad side effects?  MSDN articles never do this in examples and currently I do this as I cannot  see the harm. However I have come across a mixture of opinions so any comments are useful.
7198
What lifetime can be expected of the typical hard disk? Or are there big differences between different types? And does it make a difference if it is used heavily instead of never being connected to system (for example serving as a backup medium)?
53471
Now that it's clear , there is an associated concept that I use all the time without knowing what it really means.   I suppose everybody made once a mistake with parenthesis, resulting  in an "object is not callable" exception. What's more, using __init__ and __new__ lead to wonder what this bloody __call__ can be used for.  Could you give me some explanations, including examples with the magic method ?
99537
Correct me if I'm wrong here, but when you "delete" something from your PC all your computer does is write over some of the binary with 0's replacing the 1's.  (Or something to that effect) So when you send something to the recycle bin it writes over part of the file, and when you delete from the recycle bin it writes more?
71145
Well well well...my computer keeps on eating whatever free space is available in the hard drive. It doesn't care whether the free space is in kb,KB,MB or GB. It happens only in the C drive where my OS &amp; other program files are installed.  I used a software Windir Stat or something like that (I don't remember the name exactly) to analyze the usage of space by various programs.  In my C drive, there's a folder named AppData with loads of useless files. I don't know whether they are useful or not? Are they useful?  I was thinking about deleting the contents of that folder. I visited  for more info. WHich folder should I delete???
54034
I've been studying opengl es and an example I saw was using a "Pool" class to keep track of touch and keyboard events.  Could someone please explain how and why a pool class is needed. From what I was reading it had something to do with garbage collection and limiting the number of input classes that are made.   This all seems a little abstract to me, so if someone could please explain what is going on, I'd appreciate it, I'll pasted some code here:      public Pool(PoolObjectFactory &lt; T &gt; factory, int maxSize) {                     this.factory = factory;                  this.maxSize = maxSize;                  this.freeObjects = new ArrayList &lt; T &gt; (maxSize);          }                 public T newObject() {                 T object = null ;                 if (freeObjects.isEmpty())                         object = factory.createObject();                 else                          object = freeObjects.remove(freeObjects.size() - 1);                     return object;          }       public void free(T object) {                  if (freeObjects.size() &lt; maxSize)                          freeObjects.add(object);          }      PoolObjectFactory &lt;TouchEvent&gt; factory = new PoolObjectFactory &lt;TouchEvent&gt; () {           @Override          public TouchEvent createObject() {                   return new TouchEvent();          }       Pool &lt;TouchEvent&gt; touchEventPool = new Pool &lt;TouchEvent&gt; (factory, 50);      TouchEvent touchEvent = touchEventPool.newObject();      . . . do something here . . .      touchEventPool.free(touchEvent);   Thanks!