java可以系统输出导致内存不足问题 [英] java can system out result in out of memory issues

查看:40
本文介绍了java可以系统输出导致内存不足问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个理论问题.

java applet 上的大量系统会导致applet 内存不足吗?

Can a flood of system out on java applet , cause applet to go out of memory ?

如果是,删除跨多个文件的多个系统输出的简单解决方案是什么?

If yes what would be an easy solution to remove multiple sysout spanning across multiple files ?

推荐答案

如果 x.toString() 使用过多内存,单个 System.out.println(x) 可能会导致内存不足错误.

A single System.out.println(x) can cause an out of memory error, if x.toString() uses too much memory.

java 小程序是否会出现大量系统溢出,导致小程序内存不足?

Can a flood of system out on java applet , cause applet to go out of memory ?

重要的是结果字符串的大小,而不是数字.更多的消息会变慢,但对 Full GC 后的可用内存量没有影响,这才是最重要的.

It is size of the resulting String which matters, not the number. More messages will be slower, but make no difference to the amount of free memory after a Full GC and that is what counts.

这篇关于java可以系统输出导致内存不足问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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