You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I appreciate the effort y'all have put into developing this application. Unfortunately there's a lot of things that could be improved.
The calls to GC.Collect() and GC.WaitForPendingFinalizers() will not affect the external processes you're trying to limit. These calls only impact the .NET application running this code.
The application could be more efficient in its use of CPU cycles and memory, especially considering the frequent calls to certain methods.
The routines are sub-optimal (eg. You have several routines with the same purpose), I'd recommend giving this system a complete refactoring if anything and stop calling GC.Collect() and GC.WaitForPendingFinalizers(), it's not recommended to do so (https://learn.microsoft.com/en-us/dotnet/api/system.gc.collect?view=net-7.0).
Very poor memory management; eg. Process objects and ManagementObjectSearcher should be disposed, but they aren't.
This application lacks in exception handling as well, make sure to catch and handle errors that might occur; such as SetProcessWorkingSetSize and WMI queries.
I appreciate the effort y'all have put into developing this application. Unfortunately there's a lot of things that could be improved.
The calls to GC.Collect() and GC.WaitForPendingFinalizers() will not affect the external processes you're trying to limit. These calls only impact the .NET application running this code.
The application could be more efficient in its use of CPU cycles and memory, especially considering the frequent calls to certain methods.
The routines are sub-optimal (eg. You have several routines with the same purpose), I'd recommend giving this system a complete refactoring if anything and stop calling GC.Collect() and GC.WaitForPendingFinalizers(), it's not recommended to do so (https://learn.microsoft.com/en-us/dotnet/api/system.gc.collect?view=net-7.0).
Very poor memory management; eg. Process objects and ManagementObjectSearcher should be disposed, but they aren't.
This application lacks in exception handling as well, make sure to catch and handle errors that might occur; such as SetProcessWorkingSetSize and WMI queries.
Here are some solutions that y'all could take a look at -> https://github.com/luke-beep/MMF/blob/master/Program.cs.
The text was updated successfully, but these errors were encountered: