Destructor called while object is still alive

Kagamin spam at here.lot
Sun Oct 25 09:17:06 UTC 2020


On Saturday, 24 October 2020 at 11:56:54 UTC, Steven 
Schveighoffer wrote:
> I wrote a program long ago that used classes to manage open 
> files. I never worried about cleaning up the file handles, and 
> it worked fine.

Programs that don't care to close file handles are the reason why 
people believe that windows can't run for more than a week 
without restarts, a file handle is small for the program, but 
kernel allocates a fairly big structure about 4kb; when the 
program opens a million handles, it consumes 4gb of kernel 
memory, when a non-technical user sees this system wide memory 
shortage, he concludes time has come to restart the system. 
Particularly Nvidia user service was guilty of this and given 
that it's installed on most machines, you get the corresponding 
result.


More information about the Digitalmars-d mailing list