-
Notifications
You must be signed in to change notification settings - Fork 41.2k
memory leak problem about redirect #13771
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
Comments
Thanks for the sample. You are using Spring Boot 1.4.2 which is no longer supported. You are also using a mixture of versions of Spring Framework modules (4.3.4.RELEASE and 4.3.9.RELEASE) and of Spring Cloud modules. Please update your dependency versions to use supported versions (the latest Spring Boot 1.5.x, for example) and see if the problem remains. If it does, we'll happily take a look at an updated sample. |
Thanks, but 1.5.7 isn’t the latest 1.5.x version. Please upgrade Spring Boot to 1.5.14 and all your other dependencies to their matching latest version. |
Thanks. There are still some problems with your dependencies (mixing Spring Cloud versions, for example) but I don't think they're causing the problem you're seeing. You can reproduce your problem with Spring Boot 1.5.14, dependencies on package com.example.demo;
import java.util.UUID;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@SpringBootApplication
@EnableAspectJAutoProxy
public class Gh13771Application {
public static void main(String[] args) {
SpringApplication.run(Gh13771Application.class, args);
}
@Controller
public static class RedirectController {
@RequestMapping("/")
public String redirect() {
return "redirect:/example/" + UUID.randomUUID();
}
}
} The problem is that |
Thanks. But the Spring Framewok may think that to make the beanname to be the same is a better solution. |
Uh oh!
There was an error while loading. Please reload this page.
our team has a memory leak problem lately.
I have dump the heap and found that there are many strings in the heap. the strings is something about redirect string. So we reproduce the problem by the following demo project: https://github.com/zhao41654828/springstudy/tree/master/service-hi
controller adress: https://github.com/zhao41654828/springstudy/blob/master/service-hi/src/main/java/com/forezp/web/MiniProgramController.java
Debug the program by sending a request:127.0.0.1:8763/web/testRedirect1

we can find that it run into like this:
In the AbstractAutoProxyCreator class, the advisedBeans don't have number limit, the ConcurrentHashMap will have a lot of objects.
I want to know this is whether or not a bug in springmvc. If not, I want to know the reason and how can I to avoid it.
Now i do like this to avoid it.
The text was updated successfully, but these errors were encountered: