djangosnippets.org: Latest snippets tagged with 'memory'https://djangosnippets.org/tags/memory/2011-03-18T02:52:10.319667-05:00Non-pickling locmem (in-process memory) cache backend
2011-03-18T02:52:10.319667-05:00akaiholahttps://djangosnippets.org/snippets/2396/<p>You can use this cache backend to cache data in-process and avoid the overhead of pickling. Make absolutely sure you don't modify any data you've stored to or retrieved from the cache. Make deep copies instead if necessary.</p>
<p>The backend is basically identical to Django's stock locmem cache (as of …</p>
Freely redistributableMemory efficient Django Queryset Iterator
2010-03-03T13:00:19.278641-06:00WoLpHhttps://djangosnippets.org/snippets/1949/<p>While checking up on some cronjobs at <a href="http://www.youtellme.nl/">YouTellMe</a> we had some problems with large cronjobs that took way too much memory. Since Django normally loads all objects into it's memory when iterating over a queryset (even with .iterator, although in that case it's not Django holding it in it's memory, …</p>
Freely redistributable