java可以系统出局导致内存不足问题 [英] java can system out result in out of memory issues
问题描述
这是一个理论问题.
java applet上的系统泛滥是否会导致applet内存不足?
Can a flood of system out on java applet , cause applet to go out of memory ?
如果是,那么删除跨越多个文件的多个sysout的简便解决方案是什么?
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 applet上的系统泛滥会导致applet内存不足吗?
Can a flood of system out on java applet , cause applet to go out of memory ?
重要的是生成的String的大小,而不是数字.更多消息将变慢,但对于完全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屋!