Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] [DSF-GDB] Memory leak when running JUnit tests

I am writing JUnit tests based on the current MI*test from DSF-GDB. When
I run my JUnit tests (140+ tests) on multiple targets (total is 1000+
tests) I always run out of heap memory. Some tracing reveals there is
memory leak in the range of 1M-2M per test.

Further debugging led me to this:

In my launch delegate I create the GDB CLI process before running my
finalLaunchSequence
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=223154), and this creates
the GDB runtime process allocating around 2M buffer for input/output
(AbstractCLIProcess). When the launch is terminated this GDB runtime
process needs to be released and this is done at GDBControl.terminate()
where it schedules a MIGDBExit().

However, most of the time (8 out of 10) this MIGDBExit() is not
completed, thus the future task above it will run after 2 second. This
task does not kill the GDB process because the state is never
"State.STARTED" in this case. Not sure if it's related but running this
task results in a "rejected execution exception" which can be seen from
the console view.

I also tried running the DSF/GDB unit tests (e.g. MIRegisterTest) I can
see the same behavior that the MIGDBExit() is not completed but the
future task is run.

Thanks,
Andy



Back to the top