IOConsole causes Out Of Memory / Heap Space when writing large logs [message #1184545] |
Wed, 13 November 2013 14:27 |
Maurice Okunek Messages: 7 Registered: August 2010 |
Junior Member |
|
|
Hi,
basically i'm using some kind of a pop-up MessageConsole that will show ALL output that is generated in Eclipse (via Eclipse Console View in the UI). Our tool will process large amounts of data, each data will be shown in the console.
So let me show exactly what I have done and how to reproduce the error:
1) Pipe output streams to a custom console (via Custom Plugin):
// Create the DIS Console for InEn ETL and generic Output.
mDisConsole = findConsole("DISConsole");
MessageConsoleStream out = mDisConsole.newMessageStream();
BufferedOutputStream bout = new BufferedOutputStream(out);
// Register the DIS Console as standard output
if (out != null){
mDisConsoleStream = new PrintStream(bout);
System.setOut(mDisConsoleStream);
System.setErr(mDisConsoleStream);
... }
The BufferedOutputStream is just a test and changes nothing.
2) The custom MessageConsole is created in the following manner (All I have found as workarounds in the WWW are some parameter issues, no setting worked):
@Override
public void openConsole() {
if (fConsole == null) {
fConsole = new DISConsole();
fConsole.setConsoleWidth(0);
fConsole.setWaterMarks(0, 1000);
fConsoleManager.addConsoles(new IConsole[] { fConsole });
}
fConsoleManager.showConsoleView(fConsole);
}
3) I start a WorkspaceJob which simply writes nonsense to the console via the out stream in its runInWorkspace method:
public IStatus runInWorkspace(final IProgressMonitor pMonitor) throws CoreException {
boolean jobWasSuccessfull = true;
startETLLog4J();
String dummyLog = "Writing Obj_234235653223545\ngragerghraegbukjreaberrge\ngaergraegaergaergaer\ngaergaergaergergaegareg\ngaergeargergaergaegaerg\naegaregaergaergaerg\n\n\nefewafweewafawefawefewfweaf\nfweafwefwefwefweaf\nfweafwefwefwaefwaefweafawefwea\nfewafweafwaefwefwefawefwaefeawf\nfewafweafweafweafwaefawefweafwefwaef\nwefweafwaefwaefweafweaf\nwefwaefwaefwaefwea\nfewfwaefweafweafwaefawe\n\n\nfawefgawefawefwfawefawefeaw\nfewfwaefwaefwefwefwaef\nefawefawefawefawefwaefwaef\nwefwaefwaefawefwefweafaew\nefawefwaefawef\n\nDone.\n\n\n\n";
for (int i = 0, j=0; i < 100000; i++,j++) {
mETLLogger.error(dummyLog);
}
return new Status(IStatus.OK, DisCorePlugin.PLUGIN_ID, "OK");
}
This will cause an out of memory almost instantly (256m Xmx).
Not using a custom console and writing to the Development Eclipse Console does not cause that problems, the memory of the dev-Eclipse is barely touched.
I don't know what's the problem here, any advice?
Oh, btw.: There are several threads writing to the streams, don't know if this is a problem...
[Updated on: Wed, 13 November 2013 14:28] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.06247 seconds