仅通过编写大量Console.WriteLine,控制台应用程序最终是否会耗尽内存? [英] Can a Console Application eventually run out of memory just by writing lots of Console.WriteLine

查看:363
本文介绍了仅通过编写大量Console.WriteLine,控制台应用程序最终是否会耗尽内存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道吗?

为了进行重型测试,我编写了一个控制台应用程序,希望该应用程序可以在几天内无故障运行。至少。
此控制台应用程序将向控制台写入许多 Console.WriteLine (大约每150毫秒一行)。

For a heavy duty test I wrote a console application that I hope will run, problem free, for days. At least. This Console application will be writing lots of Console.WriteLine (about a line every 150 msec) to the console.

我是否需要担心我的记忆?因为控制台将所有文本保留在内存中。
还是Windows会以某种方式处理写入控制台的内容?

Do I have to worry about my memory at some point? Because consoles keep all text in memory. Or does Windows take care of what's written to the console somehow?

推荐答案

在属性中,布局下是一个屏幕缓冲区大小,默认设置为9000行。这就是我需要知道的。

In the properties, under Layout is a Screen Buffer Size that is set default to 9000 lines. That's all I needed to know.

感谢@ doug65536!

Thanks @doug65536!

这篇关于仅通过编写大量Console.WriteLine,控制台应用程序最终是否会耗尽内存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆