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

Tracer Memory Leak #74

Closed
isaaczinda opened this issue Aug 9, 2019 · 1 comment
Closed

Tracer Memory Leak #74

isaaczinda opened this issue Aug 9, 2019 · 1 comment

Comments

@isaaczinda
Copy link
Contributor

isaaczinda commented Aug 9, 2019

LightStep version 4.2.0, OS X

[feel free to move this to OpenTracing Python if necessary]

I've constructed a minimal reproduction of the issue here. When send_spans_memory_leak is called repeatedly, the program has a memory leak (see graph below). When send_spans_stable is called repeatedly, the program memory footprint is stable.

Although the code in send_spans_memory_leak is illogical (it never actually ends the scope), I can imagine end users writing code like this by mistake. Nevertheless, I think that incorrectly instrumenting an application shouldn't chew up this much memory.

import lightstep

def send_spans_memory_leak(tracer):
    with tracer.start_span(operation_name='make_some_request') as client_span:
        tracer.scope_manager.activate(client_span, True)
        pass

def send_spans_stable(tracer):
    with tracer.start_active_span(operation_name='make_some_request') as client_span:
        pass

# setup tracer
tracer = lightstep.Tracer(
    component_name='isaac_service',
    collector_port=8360,
    collector_host='localhost',
    collector_encryption='none',
    use_http=True,
    access_token='developer',
    max_span_records=100,
)

while True:
    send_spans_memory_leak(tracer)

image

@isaaczinda
Copy link
Contributor Author

This is actually an OpenTracing issue so I'm moving this discussion here: opentracing/opentracing-python#125.

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

No branches or pull requests

1 participant