4 ms·
Restarting the process frequently sounds like a very messy solution. It is not acceptable in all cases to restart the process frequently. For server software it
by cjfd 7y ago
Restarting the process frequently sounds like a very messy solution. It is not acceptable in all cases to restart the process frequently. For server software it is the rule that this is not acceptable. Also note that if your software is going to be used more it would need more frequent restarts. This will generally not make users happy. Maybe you could sometimes get away with starting a new process for every login. Memory usage will be higher in that case, though, perhaps unacceptably so. Also for software that is used on the desktop it would generally be frowned upon by the users.
I suppose it is possible to avoid garbage collection if you are willing to accept kind of old-style programming practices. You could have arrays of objects and when an object is no longer needed you don't deallocate it but allow it to be reused when another object of that kind is needed. I guess this would not lead to clearer code for most purposes. But, who knows, some people have been complaining about the lack of clarity in object oriented code.