-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Possible memory leak #1872
Comments
I also tested your script and get the following output.
What's your operating system? I'm using a mac |
I've tested on two machines:
|
I think if you run with |
With gc.DEBUG_LEAK absolutely the same. Memory increases rapidly |
Yes, it's expected that memory increases rapidly with DEBUG_LEAK or DEBUG_SAVEALL - those options cause garbage objects to be saved even though they are collectable. It's not a real leak. Remove those options and the "leak" will go away. There are a lot of traceback and frame objects in that log. It looks like something is holding on to an exception object which in turn holds on to a lot of other stuff. We may be able to reduce the overhead of garbage collection by breaking the cycle (although this isn't always possible). |
Hi, @bdarnell! I also experiencing circular references problem on dummy handler. And this problem is related to connections. This is the debug script which searches for circular references in the garbage after request: https://gist.github.com/homm/c20a7dc74f78d393f6ffac537532fd93 As the issue is related to connection, the server shouldn't be called from the browser because browser will keep connection for a while, and connection will keep references to resources associated with the last request. You should connect to the server from console: $ curl http://localhost:8888/dummy/ && curl http://localhost:8888/collect/
By the way, I think this is also the issue: resources associated with the last request are not freed until connection is closed. Most likely there should be one solution. My output for the script:
Most interesting objects are Of course, this is not a leak, because number of uncollectable object is zero. But I think you agree that circular references make unwanted slowdown and memory consumption. |
I also have memory leaks, when i use type : REPORTER_TYPE_SPAN_BATCH_LOG but change to REPORTER_TYPE_SPAN_LOG, there will have not that question why??????? |
I think you're asking in the wrong place this is an issue tracker for the tornado project (and an issue that was closed 5 years ago), and I don't know anything about these REPORTER constants you're referring to. If there is something related to tornado here, please open a new issue with more details. |
I also have memory leaks when working with tornado. |
Hi,
I have memory leaks even in "hello, world" example listed here http://www.tornadoweb.org/en/stable/
Code of tornado_memory_test.py: http://pastebin.com/BfG7Na9Z
Here is an example of a problem:
$ python tornado_memory_test.py
No memory leaks found!
No memory leaks found!
[I 161031 18:00:54 web:1946] 200 GET /test (127.0.0.1) 0.87ms
Memory garbage detected
[gc stat]: 73 objects in garbage
Memory garbage detected
[gc stat]: 73 objects in garbage
Memory garbage detected
[gc stat]: 73 objects in garbage
[I 161031 18:01:11 web:1946] 200 GET /test (127.0.0.1) 0.73ms
Memory garbage detected
[gc stat]: 146 objects in garbage
Here is a verbose output of garbage: http://pastebin.com/BzXudRXd
$ pip freeze | grep -i tor
tornado==4.4.2
$ python -V
Python 2.7.12
Also tried on:
$ pip freeze | grep tor
tornado==4.5.dev1
$ python -V
Python 2.7.12
The text was updated successfully, but these errors were encountered: