#26306: Memory leak in cached template loader
---------------------------------+------------------------------------
     Reporter:  AlexHill         |                    Owner:  nobody
         Type:  Bug              |                   Status:  new
    Component:  Template system  |                  Version:  1.9
     Severity:  Release blocker  |               Resolution:
     Keywords:                   |             Triage Stage:  Accepted
    Has patch:  1                |      Needs documentation:  0
  Needs tests:  1                |  Patch needs improvement:  1
Easy pickings:  0                |                    UI/UX:  0
---------------------------------+------------------------------------
Changes (by berkerpeksag):

 * cc: berker.peksag@… (added)


Comment:

 Some comments about the patch:

 * `self.missing_sentinel` is unused.
 * `TemplateMissingMarker` could live in module level.
 * There still will be some memory unnecessary memory usage because of
 `TemplateMissingMarker`. Perhaps we could define `__slots__` to reduce
 memory usage.

 Random thoughts:

 * I wonder we could use `traceback.clear_frames()`:
 https://docs.python.org/3.5/library/traceback.html#traceback.clear_frames
 Its implementation is simple:
 https://github.com/python/cpython/blob/master/Lib/traceback.py#L212
 * Instead of storing whole `TemplateDoesNotExist` object, we could only
 store exception class and values (not traceback object) in a tuple by
 using `sys.exc_info()`.

--
Ticket URL: <https://code.djangoproject.com/ticket/26306#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.1ca4dfab9471b2c70bfc0cae8c86f77d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to