DESCRIPTION

ctf: Do not call System.gc() in CTFTrace.close()

This call is used to workaround a bug/limitation of MappedByteBuffer
(see JDK-4724038). But CTFTrace.close() is called quite often
(for example, once per trace when closing an experiment), so it is not
the best place to call System.gc(). Instead, only call it when we are
about to delete/rename a trace.

Change-Id: Ib9b346dd04df4f64289ac9db0b976e6b70ff2551
Signed-off-by: Braxton Mccarthy xxx@xxx.xxx


COMMENTS

author: Braxton Mccarthy
date: 2014-04-16 22:39:24.000000000

Uploaded patch set 1.

-------------------------------------
author: Ivy Mitchell
date: 2014-04-17 01:22:23.000000000

Patch Set 1:

(1 comment)

Line:566, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfTraceElement.java -> how much of a delay does this incur? it will be done for all traces, not just ctf...

-------------------------------------
author: Ivy Mitchell
date: 2014-04-17 01:23:21.000000000

Patch Set 1:

would a gc throttler be interesting?

-------------------------------------
author: Brenden Conley
date: 2014-04-17 02:45:05.000000000

Patch Set 1:

Build Started https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/6491/

-------------------------------------
author: Brenden Conley
date: 2014-04-17 03:31:16.000000000

Patch Set 1: Verified+1

Build Successful 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/6491/ : SUCCESS

-------------------------------------
author: Braxton Mccarthy
date: 2014-04-17 03:52:48.000000000

Patch Set 1:

(1 comment)

> would a gc throttler be interesting?

I don't think we should encourage using System.gc() ;)

Line:566, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfTraceElement.java -> Indeed, I wanted to do if (instanceof CtfTmfTrace) at first, but CtfTmfTrace is in a separate plugin now, we can't use it anymore ;)

This is only called when you either Delete or Rename a trace (from the Project Explorer) though. Or when you move it from one sub-folder to another, with Patrick's upcoming patches. If you close an experiment with 200 traces, this doesn't get called at all, whereas CTFTrace.close() gets called 200 times...

-------------------------------------
author: Ivy Mitchell
date: 2014-04-17 13:28:54.000000000

Patch Set 1:

(1 comment)

Line:566, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfTraceElement.java -> abstract class TmfMappingTrace?

-------------------------------------
author: Luciana Barry
date: 2014-04-17 14:01:56.000000000

Patch Set 1:

(1 comment)

Line:566, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfTraceElement.java -> I don't think there's enough harm in calling System.gc() once for a user command to justify creating a new base class to avoid it.
That being said, can you try the following use case: close an editor with such a trace then quickly try to delete the trace (maybe it will only fail in Windows?). If that is the case perhaps the System.gc() should be called in TmfEventsEditor.dispose() instead? Or TmfEventsTable.dispose(), where the trace is disposed?

-------------------------------------
author: Luciana Barry
date: 2014-04-17 14:46:48.000000000

Patch Set 1: Verified+1 Code-Review+1

(1 comment)

Line:566, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfTraceElement.java -> I tested the use case above and the trace is deleted correctly in Windows. It is not a problem because we call System.gc() even if no editor needed to be closed...

-------------------------------------
author: Braxton Mccarthy
date: 2014-04-17 15:40:13.000000000

Patch Set 1: Code-Review+2

-------------------------------------
