[JBoss JIRA] (ARQ-2203) Regression: Memory leak in DeploymentContextImpl.stores
by Rich DiCroce (Jira)
Rich DiCroce created ARQ-2203:
---------------------------------
Summary: Regression: Memory leak in DeploymentContextImpl.stores
Key: ARQ-2203
URL: https://issues.jboss.org/browse/ARQ-2203
Project: Arquillian
Issue Type: Bug
Components: core
Affects Versions: 1.4.0.Final
Reporter: Rich DiCroce
DeploymentContexts are never destroyed. This creates a memory leak and can lead to OOME due to heap exhaustion.
This was previously reported as ARQ-1949. Comments on that issue indicate it was fixed somewhere between 1.1.7 and 1.1.13. The final comment cites ARQ-1992, but the fix for that issue doesn't appear related to this problem at all. In any case, if this was fixed, it has since regressed. AFAICT there is no code that ever calls DeploymentContext#destroy() anywhere in Arquillian.
For anyone else affected by this issue, there is a workaround. Create a LoadableExtension that properly destroys the deployment after it is no longer needed:
{code}
public class ArquillianLeakFix implements LoadableExtension {
@Override
public void register(ExtensionBuilder builder) {
builder.observer(DeploymentDestroyer.class);
}
public static class DeploymentDestroyer {
@Inject
private Instance<DeploymentContext> deploymentContext;
public void destroyDeployment(@Observes(precedence = Integer.MIN_VALUE) final UnDeployDeployment event) {
deploymentContext.get().destroy(event.getDeployment());
}
}
}
{code}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 11 months
[JBoss JIRA] (ARQ-2202) Include org.hamcrest out of box
by Ladislav Thon (Jira)
[ https://issues.jboss.org/browse/ARQ-2202?page=com.atlassian.jira.plugin.s... ]
Ladislav Thon commented on ARQ-2202:
------------------------------------
My understanding is that JUnit 4 _requires_ Hamcrest to be present, otherwise loading some JUnit classes fails. TestNG doesn't have such dependency on Hamcrest, which is why Arquillian's {{TestNGDeploymentAppender}} doesn't (and IMHO shouldn't) automatically include it.
> Include org.hamcrest out of box
> -------------------------------
>
> Key: ARQ-2202
> URL: https://issues.jboss.org/browse/ARQ-2202
> Project: Arquillian
> Issue Type: Bug
> Components: Build Infrastructure
> Environment: n/a
> Reporter: Emily Jiang
> Priority: Major
>
> At the moment, if I want to use org.hamcrest, I have to package the classes on my own. I think it will be great if the class TestNGDeploymentAppender adds org.hamcrest classes automatically. It will be great. By the way, I think in junit, org.hamcrest classes are accessible out of box. I think TestNG should match that.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 11 months