Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WiretapConnector does not clean up exchanges [SPR-15744] #20300

Closed
spring-projects-issues opened this issue Jul 6, 2017 · 1 comment
Closed

WiretapConnector does not clean up exchanges [SPR-15744] #20300

spring-projects-issues opened this issue Jul 6, 2017 · 1 comment

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Jul 6, 2017

Rob Winch opened SPR-15744 and commented

WiretapConnector.exchanges leaks memory by referring to the ExchangeResult. For example, the following code will result in WiretapConnector.exchanges having a reference to Long.MAX_VALUE number of ExchangeResult instances.

@Test
public void testMemory() throws Exception {
	WebTestClient webTestClient = WebTestClient
		.bindToController(new TestController())
		.build();
	for(int i=0;i<Long.MAX_VALUE;i++) {
		this.webTestClient.get().uri("/")
			.exchange()
			.expectStatus().isOk()
			.expectBody(String.class).isEqualTo("Hello!");
	}
}

@RestController
static class TestController {
	@GetMapping("/")
	public String handle() {
		return "Hello!";
	}
}

Referenced from: commits aad4916

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jul 6, 2017

Rossen Stoyanchev commented

The claimRequest method used to remove them, not sure when that got changed and I don't see a reason not to so I've fixed that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants