Community
Participate
Working Groups
(Eclipse 3.6.1) When a launch configuration is started by buckminster (calling e.g. 'launch -l aLauncher.launch') and within a lot of output will be written to the console a OutOfMemoryError might crop up. As I have tracked the problem down it seem that if the OutputStreamMonitor will never be flushed by anyone the internal StringBuffer will grow up to any size. And it looks like this will happen e.g. in a Hudson environment. So if the StringBuffer will get too large the OutputStreamMonitor needs to be flushed (calling org.eclipse.debug.internal.core.OutputStreamMonitor.flushContents()) Exception in thread "Output Stream Monitor" java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:2882) at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100) at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:390) at java.lang.StringBuffer.append(StringBuffer.java:224) at org.eclipse.debug.internal.core.OutputStreamMonitor.read(OutputStreamMonitor.java:154) at org.eclipse.debug.internal.core.OutputStreamMonitor.access$1(OutputStreamMonitor.java:134) at org.eclipse.debug.internal.core.OutputStreamMonitor$1.run(OutputStreamMonitor.java:207) at java.lang.Thread.run(Thread.java:619)
Created attachment 181854 [details] This can help (but it's not as good as it should be) In our environment this patch has solved the problem. But it's not as good as I'll like it to be. The StreamMonitor has to be flushed at the right time. But when is it? In this patch the stream will be flushed every time a text will be appended. I think this is too often! Does someone have a better idea? Please...
I think this fix is OK. We don't care about the string that is built up in the StreamMonitor anyway so it doesn't matter that it is truncated often. I have applied the patch to helios-maintenance, rev 11655. Thanks.