Hi all,

I'm trying to run the Django testsuite against my new SQL Server backend, but
I'm getting OOM errors which I'm pretty sure are unrelated to my database code.

I'm running tests like this:

  jython --verify c:\dev\django-trunk\tests\runtests.py --settings=settings -v 2

and my stacktrace is below.

Qualitatively - the django testsuite runs *really* slow. 

Has anyone seen anything like this?  It looks like some kind of difference in
the GC behaviour between Java and CPython.

vic

Running post-sync handlers for application admin_views
Adding content type 'admin_views | section'
Traceback (most recent call last):
  File "c:\dev\django-trunk\tests\runtests.py", line 183, in <module>
    django_tests(int(options.verbosity), options.interactive, args)
  File "c:\dev\django-trunk\tests\runtests.py", line 153, in django_tests
    failures = run_tests(test_labels, verbosity=verbosity,
interactive=interactive, extra_tests=extra_tests)
  File "C:\jython2.5b0\Lib\site-packages\django\test\simple.py", line 142, in
run_tests
    connection.creation.create_test_db(verbosity, autoclobber=not interactive)
  File "C:\jython2.5b0\Lib\site-packages\django\db\backends\creation.py",
line315, in create_test_db
    call_command('syncdb', verbosity=verbosity, interactive=False)
  File "C:\jython2.5b0\Lib\site-packages\django\core\management\__init__.py",
line 158, in call_command
    return klass.execute(*args, **options)
  File "C:\jython2.5b0\Lib\site-packages\django\core\management\base.py", line
222, in execute
    output = self.handle(*args, **options)
  File "C:\jython2.5b0\Lib\site-packages\django\core\management\base.py", line
351, in handle
    return self.handle_noargs(**options)
  File
"C:\jython2.5b0\Lib\site-packages\django\core\management\commands\syncdb.py",
line 98, in handle_noargs
    emit_post_sync_signal(created_models, verbosity, interactive)
  File "C:\jython2.5b0\Lib\site-packages\django\core\management\sql.py", line
203, in emit_post_sync_signal
    models.signals.post_syncdb.send(sender=app, app=app,
  File "C:\jython2.5b0\Lib\site-packages\django\dispatch\dispatcher.py", line
148, in send
    response = receiver(signal=self, sender=sender, **named)
  File
"C:\jython2.5b0\Lib\site-packages\django\contrib\contenttypes\management.py",
line 18, in update_contenttypes
    ct = ContentType.objects.get(app_label=opts.app_label,
  File "C:\jython2.5b0\Lib\site-packages\django\db\models\manager.py", line 93,
in get
    return self.get_query_set().get(*args, **kwargs)
  File "C:\jython2.5b0\Lib\site-packages\django\db\models\query.py", line 303,
in get
    clone = self.filter(*args, **kwargs)
  File "C:\jython2.5b0\Lib\site-packages\django\db\models\query.py", line 489,
in filter
    return self._filter_or_exclude(False, *args, **kwargs)
  File "C:\jython2.5b0\Lib\site-packages\django\db\models\query.py", line 503,
in _filter_or_exclude
    clone = self._clone()
  File "C:\jython2.5b0\Lib\site-packages\django\db\models\query.py", line 601,
in _clone
    query = self.query.clone()
  File "C:\jython2.5b0\Lib\site-packages\django\db\models\sql\query.py", line
172, in clone
    obj.dupe_avoidance = self.dupe_avoidance.copy()
java.lang.OutOfMemoryError: Java heap space
        at java.util.concurrent.locks.ReentrantLock.<init>(ReentrantLock.java:234)
        at
java.util.concurrent.ConcurrentHashMap$Segment.<init>(ConcurrentHashMap.java:289)
        at java.util.concurrent.ConcurrentHashMap.<init>(ConcurrentHashMap.java:613)
        at java.util.concurrent.ConcurrentHashMap.<init>(ConcurrentHashMap.java:664)
        at org.python.core.PyDictionary.<init>(PyDictionary.java:55)
        at org.python.core.PyDictionary.dict_copy(PyDictionary.java:394)
        at org.python.core.PyDictionary$dict_copy_exposer.__call__(Unknown Source)
        at
django.db.models.sql.query$py.clone$9(C:\jython2.5b0\Lib\site-packages\django\db\models\sql\query.py)
        at
django.db.models.sql.query$py.call_function(C:\jython2.5b0\Lib\site-packages\django\db\models\sql\query.py)
        at org.python.core.PyTableCode.call(PyTableCode.java:199)
        at org.python.core.PyTableCode.call(PyTableCode.java:427)
        at org.python.core.PyTableCode.call(PyTableCode.java:321)
        at org.python.core.PyFunction.__call__(PyFunction.java:333)
        at org.python.core.PyMethod.instancemethod___call__(PyMethod.java:130)
        at org.python.core.PyMethod.__call__(PyMethod.java:99)
        at org.python.core.PyObject.__call__(PyObject.java:266)
        at
django.db.models.query$py._clone$49(C:\jython2.5b0\Lib\site-packages\django\db\models\query.py)
        at
django.db.models.query$py.call_function(C:\jython2.5b0\Lib\site-packages\django\db\models\query.py)
        at org.python.core.PyTableCode.call(PyTableCode.java:199)
        at org.python.core.PyTableCode.call(PyTableCode.java:427)
        at org.python.core.PyTableCode.call(PyTableCode.java:321)
        at org.python.core.PyFunction.__call__(PyFunction.java:333)
        at org.python.core.PyMethod.instancemethod___call__(PyMethod.java:130)
        at org.python.core.PyMethod.__call__(PyMethod.java:99)
        at org.python.core.PyObject.__call__(PyObject.java:266)
        at
django.db.models.query$py._filter_or_exclude$41(C:\jython2.5b0\Lib\site-packages\django\db\models\query.py)
        at
django.db.models.query$py.call_function(C:\jython2.5b0\Lib\site-packages\django\db\models\query.py)
        at org.python.core.PyTableCode.call(PyTableCode.java:199)
        at org.python.core.PyTableCode.call(PyTableCode.java:427)
        at org.python.core.PyTableCode.call(PyTableCode.java:321)
        at org.python.core.PyFunction.__call__(PyFunction.java:333)
        at org.python.core.PyMethod.instancemethod___call__(PyMethod.java:130)

java.lang.OutOfMemoryError: java.lang.OutOfMemoryError: Java heap space