You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, I noticed some very strange memory usage issues lately. I'm using pytest-django 2.7 and Django 1.7, with Postgres 9.3 (+PostGis) as the database.
Basically if I run py-test on my test suite with --create-db (to create a new database), my Python process balloons to 700-800MB right off the bat (while the database is being created, and Django migrations are run), and stays at least that high (800MB+) throughout the test run. This is leading to out-of-memory issues on our integration server.
If I don't do --create-db and reuse the existing test database (--reuse-db), memory usage is normal (~150-200MB) throughout the test run.
When I was using Django 1.6 and pytest-django 2.6.2, there was no difference in memory between reusing and creating the test DB.
Any ideas? The main difference is that I'm using Django 1.7's migrations now (used to use South with Django 1.6, and --create-db just skipped South entirely).
The text was updated successfully, but these errors were encountered:
Yeah, definitely something fishy here. I haven't looked at the memory usage, but the duration says a lot: with --create-db my tests take 10 seconds; with reuse-db just one second. Squashing all my migrations had no effect, either.
Same problem here. Seems like django migrate creates thousands of models and fields and never release them. In the standalone command it's not as bad, but testrunners use connection.create_db which in turn calls call_command('migrate') before running the tests in the same process, thus keeping the memory full. If someone has a solution, I'd gladly hear about it.
By now we have --no-migrations also, which currently still calls the migrate command, but with no-op migrations. With #729 it skips the migrate command altogether.
Hey, I noticed some very strange memory usage issues lately. I'm using pytest-django 2.7 and Django 1.7, with Postgres 9.3 (+PostGis) as the database.
Basically if I run py-test on my test suite with --create-db (to create a new database), my Python process balloons to 700-800MB right off the bat (while the database is being created, and Django migrations are run), and stays at least that high (800MB+) throughout the test run. This is leading to out-of-memory issues on our integration server.
If I don't do --create-db and reuse the existing test database (--reuse-db), memory usage is normal (~150-200MB) throughout the test run.
When I was using Django 1.6 and pytest-django 2.6.2, there was no difference in memory between reusing and creating the test DB.
Any ideas? The main difference is that I'm using Django 1.7's migrations now (used to use South with Django 1.6, and --create-db just skipped South entirely).
The text was updated successfully, but these errors were encountered: