-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a memory leak in HTTPServer with very large file uploads.
This is not quite a true leak since the garbage collector will reclaim everything when it runs, but it might as well be a leak because CPython's garbage collector uses heuristics based on the number of allocated objects to decide when to run. Since this scenario resulted in a small number of very large objects, the process could consume a large amount of memory. The actual change is to ensure that HTTPConnection always sets a close_callback on the IOStream instead of waiting for the Application to set one. I also nulled out a few more references to break up cycles. Closes #740. Closes #747. Closes #760.
- Loading branch information
Showing
1 changed file
with
10 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12780c1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about manual call gc.collect?
12780c1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gc.collect() is expensive; it's a bad idea to call it in normal circumstances.