﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
6217	(u)gettext_lazy is a memory hog	Jakub Wilk <ubanus@…>	Malcolm Tredinnick	"Objects created by a `gettext_lazy`/`ugettext_lazy` call occupies almost 12 KiB of memory.
This makes Django pretty unusable in an i18n environment with limited memory.

Here's a proof:
{{{
>>> import guppy
>>> heapy = guppy.hpy()
>>> heapy.heap()
Partition of a set of 68757 objects. Total size = 4651296 bytes.
  Index  Count   %     Size   % Cumulative  % Kind (class / dict of class)
      0  25728  37  1694752  36   1694752  36 str
      1  16723  24   615380  13   2310132  50 tuple
      2   7201  10   403256   9   2713388  58 function
      3    521   1   274376   6   2987764  64 dict (no owner)
      4    197   0   249512   5   3237276  70 dict of module
      5   3516   5   239088   5   3476364  75 types.CodeType
      6    474   1   206060   4   3682424  79 type
      7    474   1   189072   4   3871496  83 dict of type
      8   7623  11   182952   4   4054448  87 __builtin__.cell
      9    218   0   102608   2   4157056  89 dict of class
<269 more rows. Type e.g. '_.more' to view.>
>>> from django.utils.translation import ugettext_lazy
>>> tmp = [ugettext_lazy('foo%d' % i) for i in xrange(1000)]
>>> heapy.heap()
Partition of a set of 320759 objects. Total size = 16691776 bytes.
  Index  Count   %     Size   % Cumulative  % Kind (class / dict of class)
      0  68201  21  3819256  23   3819256  23 function
      1 129623  40  3110952  19   6930208  42 __builtin__.cell
      2  78723  25  2595380  16   9525588  57 tuple
      3   3521   1  2218760  13  11744348  70 dict (no owner)
      4   1054   0  1762288  11  13506636  81 dict of django.utils.functional.__proxy__
      5  26728   8  1726712  10  15233348  91 str
      6    197   0   249512   1  15482860  93 dict of module
      7   3516   1   239088   1  15721948  94 types.CodeType
      8    474   0   206060   1  15928008  95 type
      9    474   0   189072   1  16117080  97 dict of type
<269 more rows. Type e.g. '_.more' to view.>
}}}"		closed	Internationalization	dev		fixed			Accepted	1	0	0	0	0	0
