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

Spring Plugin Maybe cause memory leak in some case #2546

Closed
IanCao opened this issue Apr 27, 2019 · 2 comments
Closed

Spring Plugin Maybe cause memory leak in some case #2546

IanCao opened this issue Apr 27, 2019 · 2 comments
Assignees
Labels
agent Language agent related. bug Something isn't working and you are sure it's a bug! core feature Core and important feature. Sometimes, break backwards compatibility.
Milestone

Comments

@IanCao
Copy link
Contributor

IanCao commented Apr 27, 2019

Please answer these questions before submitting your issue.

  • Why do you submit this issue?
    Bug

Spring Plugin Maybe cause memory leak in some case
image
org.apache.skywalking.apm.plugin.spring.mvc.commons.interceptor.AbstractMethodInterceptor

this is the key code.

the case is one @RequestMapping method(methodA) call other @RequestMapping method(methodB).

beforeMethodA--> methodA -> beforeMethodB -> methodB -> afterMethodB - >afterMethodA

beforeMethodA, a entry is creatted.
beforeMethodB, entry size++;
afterMethodB, entry size--(entry still in stack) & RESPONSE_KEY_IN_RUNTIME_CONTEXT removed.
afterMethodA, since RESPONSE_KEY_IN_RUNTIME_CONTEXT is null,return

all process has finished,but stack in thread is not empty.

@wu-sheng wu-sheng added this to the 6.1.0 milestone Apr 27, 2019
@wu-sheng wu-sheng added agent Language agent related. bug Something isn't working and you are sure it's a bug! core feature Core and important feature. Sometimes, break backwards compatibility. labels Apr 27, 2019
@wu-sheng
Copy link
Member

@IanCao Good catch. I have discussed with @ascrutae , we think we should

  1. Add a stack-based flag in the running context.
  2. Only create Entry Span when this flag does not exist.
  3. Create Local Span when flag exists.
  4. Clear running context(request/response) if flag is reset to 0.

What do you think?

@IanCao
Copy link
Contributor Author

IanCao commented Apr 27, 2019

OK~~

ascrutae added a commit to ascrutae/sky-walking that referenced this issue Apr 28, 2019
@ascrutae ascrutae mentioned this issue Apr 28, 2019
3 tasks
wu-sheng pushed a commit that referenced this issue May 10, 2019
peng-yongsheng pushed a commit that referenced this issue May 14, 2019
* Fix #2546

* Change the stackdepth type

* Fix bug

* Fix CI failed

* fix #2599

* fix ci

* add license

* add ActiveTag error methods

* fix

* fix

* fix doc

* update doc

* update dependencyManagement

* fix
peng-yongsheng pushed a commit that referenced this issue May 14, 2019
* Fix #2546

* Change the stackdepth type

* Fix bug

* Fix CI failed

* fix #2599

* fix ci

* add license

* add ActiveTag error methods

* fix

* fix

* nacos

* nacos

* nacos

* nacos

* fix ci

* support nacos cluster

* fix yml

* fix license

* fix ci

* remove optional

* update license

* update license and doc

* fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent Language agent related. bug Something isn't working and you are sure it's a bug! core feature Core and important feature. Sometimes, break backwards compatibility.
Projects
None yet
Development

No branches or pull requests

3 participants