Django Sphinx中的MemoryError!

时间:2011-05-25 06:34:52

标签: django sphinx

整个错误是:

Traceback (most recent call last):
  File "C:/Documents and Settings/aaa/trysphinx/views.py", line 30, in <module>
    print list(results)
  File "C:\Python27\lib\site-packages\django_sphinx-2.2.4-py2.7.egg\djangosphinx\models.py", line 243, in __iter__
    return iter(self._get_data())
  File "C:\Python27\lib\site-packages\django_sphinx-2.2.4-py2.7.egg\djangosphinx\models.py", line 422, in _get_data
    self._result_cache = list(self._get_results())
  File "C:\Python27\lib\site-packages\django_sphinx-2.2.4-py2.7.egg\djangosphinx\models.py", line 557, in _get_results
    results = self._get_sphinx_results()
  File "C:\Python27\lib\site-packages\django_sphinx-2.2.4-py2.7.egg\djangosphinx\models.py", line 529, in _get_sphinx_results
    results = client.Query(self._query, self._index)
  File "C:\Python27\lib\site-packages\django_sphinx-2.2.4-py2.7.egg\djangosphinx\apis\api263\__init__.py", line 388, in Query
    response = self._GetResponse(sock, VER_COMMAND_SEARCH)
  File "C:\Python27\lib\site-packages\django_sphinx-2.2.4-py2.7.egg\djangosphinx\apis\api263\__init__.py", line 144, in _GetResponse
    chunk = sock.recv(left)
MemoryError

请帮帮我。

1 个答案:

答案 0 :(得分:0)

您正在将更多数据加载到内存中,而不是计算机可以处理的内容。也许而不是:

print list(results)

...执行:

for r in results:
    print r