Closed GoogleCodeExporter closed 9 years ago
The same problem also occurs in the class GlobalConfiguration. If you analyze
the thread dump after a PermGen Out Of Memory exception, you will find
instances of org.mockito.configuration.DefaultMockitoConfiguration (along with
instances of org.mockito.internal.progress.MockingProgressImpl, described
above).
This is because new DefaultMockitoConfigurations are created by the finalizer
thread in the class GlobalConfiguration, same problem as desribed above. You
can reuse the same test case as above, but put a breakpoint in
GlobalConfiguration.createConfig() line 37 instead.
Please see the stack trace for this problem below:
Daemon System Thread [Finalizer] (Suspended (breakpoint at line 37 in
GlobalConfiguration))
GlobalConfiguration.createConfig() line: 37
GlobalConfiguration.<init>() line: 32
GlobalConfiguration.validate() line: 47
MockingProgressImpl.validateMostStuff() line: 82
MockingProgressImpl.validateState() line: 69
ThreadSafeMockingProgress.validateState() line: 49
MockHandlerImpl<T>.handle(Invocation) line: 63
NullResultGuardian.handle(Invocation) line: 29
InvocationNotifierHandler<T>.handle(Invocation) line: 38
MethodInterceptorFilter.intercept(Object, Method, Object[], MethodProxy) line: 51
StaticCalculator$$EnhancerByMockitoWithCGLIB$$33b925ba.finalize() line: not available
Finalizer.invokeFinalizeMethod(Object) line: not available [native method]
Finalizer.runFinalizer() line: not available
Finalizer.access$100(Finalizer) line: not available
Finalizer$FinalizerThread.run() line: not available
Original comment by hen...@akarlsson.com
on 26 Jun 2013 at 12:10
Hi,
Wow pretty deep stuff, Powermock is not maintained here, but I'm curious as to
why our objects are created in the Finalizer thread.
@Henrik the leak with GlobalConfiguration happens with the Mockito + Powermock
combination ?
Is it reproducible without Powermock ?
Anyway I'm just reading the issue, I don't yet see how to fix that, and the
team is open to suggestions.
Cheers,
Brice
Original comment by brice.du...@gmail.com
on 13 Nov 2013 at 9:43
Hi Brice,
The problem should only occur when using Mockito + Powermock together. I have
created a patch in Powermock to solve it, please see
https://code.google.com/p/powermock/issues/detail?id=207#c39. This will be
included in the next released version of Powermock
(http://powermock.googlecode.com/svn/trunk/changelog.txt).
Thanks and regards,
Henrik
Original comment by hen...@devalett.se
on 13 Nov 2013 at 4:59
OK many thanks Henrik
I'll mark this issue as invalid since the patch is on the Powermock code base.
Cheers,
Brice
Original comment by brice.du...@gmail.com
on 8 Jan 2014 at 1:31
Original issue reported on code.google.com by
petar.pe...@gmail.com
on 10 Jun 2013 at 2:30Attachments: