hello everyone,
I have a rather "well connected" model like this ( used here:
http://www.splicemusic.com/contests/ ):
class Contest(models.Model):
[ snip of regular fields ]
# the sounds people HAVE to use to enter the contest
required_sounds = models.ManyToManyField(Sound, null=True,
blank=True)
# the soungs people HAVE to use to enter the contest
required_songs = models.ManyToManyField(Song, null=True, blank=True)
# how they should tag theior sounds to enter the competition
sound_tag = models.ForeignKey('Tag',
related_name=u'contest_sound_set')
# how they should tag their song to enter the competition
song_tag = models.ForeignKey('Tag',
related_name=u'contest_song_set')
# the winners of the contes if it's already finished
winners = models.ManyToManyField(Profile, null=True, blank=True)
# a forum thread w/ more explanations
forum_thread = models.ForeignKey(Thread, null=True, blank=True)
As you can see, quite a lot of many-to-many and foreign keys in there
(and they all point to tables with over 30K entries, so the admin page
takes about 10 minutes to load). Now, when we try to edit this model in
the admin the apache instance goes nuts and starts eating ALL the memory
on the machine: it almost immediately jumps to 1.5GB of RAM and then
just keeps consuming until the kernell kills the process.
Does anyone have an idea why this could be?? No other models in our
application show this behaviour (then again, no other model has this
many connections to the rest of the models)
Editing the model via manage.py shell works just fine.
- bram