Closed vinhbt closed 3 years ago
Please attach an example that reproduces the issue
And what are the steps to reproduce with the attached example?
Please wait, I will create a docker compose file and a sample service to reproduce this bug
that would be a great help, thanks
test.zip I write a docker-compose file that can help you to reproduce this bug.
Some error log from my server: Exception in thread "RxSchedulerPurge-1" java.lang.OutOfMemoryError: Java heap space 10/1/2020 4:53:15 PM Exception in thread "nioEventLoopGroup-1-1" java.lang.OutOfMemoryError: Java heap space 10/1/2020 4:53:16 PM 2020-10-01T09:53:15.913 WARN i.n.u.c.AbstractEventExecutor - A task raised an exception. Task: io.reactivex.internal.schedulers.ExecutorScheduler$ExecutorWorker@25abdd86 10/1/2020 4:53:16 PM java.lang.OutOfMemoryError: Java heap space 10/1/2020 4:53:16 PM 2020-10-01T09:53:16.749 ERROR i.m.s.DefaultTaskExceptionHandler - Error invoking scheduled task for bean [io.micronaut.management.health.monitor.HealthMonitorTask@4aa8ff83] Java heap space 10/1/2020 4:53:16 PM java.lang.OutOfMemoryError: Java heap space 10/1/2020 4:53:16 PM Exception in thread "nioEventLoopGroup-1-2" java.lang.OutOfMemoryError: Java heap space 10/1/2020 4:53:30 PM Exception in thread "nioEventLoopGroup-1-3" java.lang.OutOfMemoryError: Java heap space
any news on this? we see the same behaviour with 2.2.0. RAM constantly grows until we run OOM
Will investigate, thanks for the reminder
@vinhbt I am not able to reproduce with the example attached (I upgraded the sample to 2.2.0), I have tried reducing my docker resources, did you place load on the server with something or how did you call the server? I have run 30-40 curl requests and memory usage is largely stable (fluctuates sometimes but goes back down)
@meredrica if you have another example please feel free to attach to the issue
@graemerocher I have tried with 2000 call for my example.
for i in seq 1 2000
; do curl --location --request GET 'http://localhost:8080/api/user/test' \n--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI0OTgiLCJuYmYiOjE2MDEzMDAzNzIsInJvbGVzIjpbIlVTRVIiXSwiaXNzIjoibWljcm9uYXV0LXN3YWdnZXIiLCJtb2JpbGUiOiIrODQ1NTU1NTU1NTUiLCJleHAiOjE2MDEzODY3NzIsImlhdCI6MTYwMTMwMDM3Mn0.o3srTjnsYifbIHqmyCzfaHSt7xQZtm1OP9-tUi0an7I';
@vinhbt ok will try.. thanks
Thanks for reporting an issue, please review the task list below before submitting the issue. Your issue report will be closed if the issue is incomplete and the below tasks not completed.
NOTE: If you are unsure about something and the issue is more of a question a better place to ask questions is on Stack Overflow (https://stackoverflow.com/tags/micronaut) or Gitter (https://gitter.im/micronautfw/). DO NOT use the issue tracker to ask questions.
Task List
Steps to Reproduce
Create a filter @Filter("/**") public class ProxyFilter extends OncePerRequestHttpServerFilter { @Override protected Publisher<MutableHttpResponse<?>> doFilterOnce(HttpRequest<?> request, ServerFilterChain chain) {
client.proxy( request.mutate() .uri(b -> b.scheme("http") .host(route.getHost()) .port(route.getPort()) ) .header(INTERNAL_USER_ID, userUid) .header(EXTERNAL_CALL, "true") } }
Memory leak occur
Expected Behaviour
Not memory leak
Environment Information
Example Application
@Filter("/**") public class ProxyFilter extends OncePerRequestHttpServerFilter {