﻿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
23623	ModelChoiceField generates unused temporary cache	Thomas C	nobody	"There is a huge memory consumption when using some admin pages with big production datasets (see also https://groups.google.com/forum/#!topic/django-users/YYlLWyBH_go).

I looked into the `ModelChoiceIterator` used to generate the choices for a `ModelChoiceField`, and noticed that an unused temporary queryset cache was generated due to the use of `.all()` (there is no variable pointing to the cloned queryset after the iteration).

With the proposed PR, this cache is no longer generated. After applying the patch, I noticed that the maximum memory usage dropped from ~200MB to ~150MB for a model with about 30 000 instances."	Cleanup/optimization	closed	Forms	dev	Normal	fixed	ModelChoiceField, admin		Unreviewed	1	0	0	0	0	0
