Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 195427 Details for
Bug 323071
Memory leak in running JUnit tests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Fix to avoid large memory leak
z.leak.patch (text/plain), 3.44 KB, created by
Marc Khouzam
on 2011-05-11 16:25:32 EDT
(
hide
)
Description:
Fix to avoid large memory leak
Filename:
MIME Type:
Creator:
Marc Khouzam
Created:
2011-05-11 16:25:32 EDT
Size:
3.44 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.dsf.gdb >Index: src/org/eclipse/cdt/dsf/mi/service/command/AbstractCLIProcess.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/AbstractCLIProcess.java,v >retrieving revision 1.7 >diff -u -r1.7 AbstractCLIProcess.java >--- src/org/eclipse/cdt/dsf/mi/service/command/AbstractCLIProcess.java 3 Jun 2010 00:09:36 -0000 1.7 >+++ src/org/eclipse/cdt/dsf/mi/service/command/AbstractCLIProcess.java 11 May 2011 20:17:06 -0000 >@@ -67,10 +67,10 @@ > private final OutputStream fOutputStream = new CLIOutputStream(); > > // Client process console stream. >- private final PipedInputStream fMIInConsolePipe; >- private final PipedOutputStream fMIOutConsolePipe; >- private final PipedInputStream fMIInLogPipe; >- private final PipedOutputStream fMIOutLogPipe; >+ private PipedInputStream fMIInConsolePipe; >+ private PipedOutputStream fMIOutConsolePipe; >+ private PipedInputStream fMIInLogPipe; >+ private PipedOutputStream fMIOutLogPipe; > > private boolean fDisposed = false; > >@@ -142,11 +142,26 @@ > > @ConfinedToDsfExecutor("fSession#getExecutor") > public void dispose() { >+ if (fDisposed) return; >+ > fCommandControl.removeEventListener(this); > fCommandControl.removeCommandListener(this); > > closeIO(); > fDisposed = true; >+ >+ // We have memory leaks that prevent this class from being >+ // GCed. The problem becomes bad because we are holding >+ // two LargePipedInputStream and eventually, the JUnit tests >+ // run out of memory. To address this particular problem, >+ // before the actual causes of the leaks are fixed, lets >+ // make sure we release all our four streams which all have >+ // a reference to a LargePipedInputStream >+ // Bug 323071 >+ fMIInConsolePipe = null; >+ fMIInLogPipe = null; >+ fMIOutConsolePipe = null; >+ fMIOutLogPipe = null; > } > > private void closeIO() { >@@ -213,8 +228,10 @@ > > setPrompt(str); > try { >- fMIOutConsolePipe.write(str.getBytes()); >- fMIOutConsolePipe.flush(); >+ if (fMIOutConsolePipe != null) { >+ fMIOutConsolePipe.write(str.getBytes()); >+ fMIOutConsolePipe.flush(); >+ } > } catch (IOException e) { > } > } else if (oobr instanceof MILogStreamOutput) { >@@ -222,8 +239,10 @@ > String str = out.getString(); > if (str != null) { > try { >+ if (fMIOutLogPipe != null) { > fMIOutLogPipe.write(str.getBytes()); > fMIOutLogPipe.flush(); >+ } > } catch (IOException e) { > } > } >@@ -299,8 +318,10 @@ > // Add a space for readability > String str = SECONDARY_PROMPT + ' '; > try { >- fMIOutConsolePipe.write(str.getBytes()); >- fMIOutConsolePipe.flush(); >+ if (fMIOutConsolePipe != null) { >+ fMIOutConsolePipe.write(str.getBytes()); >+ fMIOutConsolePipe.flush(); >+ } > } catch (IOException e) { > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
marc.khouzam
:
iplog-
Actions:
View
|
Diff
Attachments on
bug 323071
: 195427