I'm trying to develop a long running C# console application, gradually, I realize the console window accumulating message and seems no auto-clean mechanism (by sitting and observing for a day). So, here I am, Is there a nice way to limit C# console application memory consumption for displaying content? For example, discard previous rows and put memory usage under control.
Asked
Active
Viewed 38 times
2
-
1If you go to the command prompt menu and select Properties -> Layout, you'll see a setting for "Screen buffer size". This already restricts the maximum number of lines in the console, and as new lines exceed that, the oldest lines will be discarded. So there IS an "auto-clean" mechanism. – Matthew Watson Dec 14 '21 at 12:05