如何提高python中的内存限制?

如何提高python中的内存限制?,python,python-2.7,out-of-memory,Python,Python 2.7,Out Of Memory,我已经编写了一个python(2.7)脚本,但它使用了大量内存,因此出现了内存不足错误。可以使用内存吗 我的代码(): 错误: Searching all the combinations... Traceback (most recent call last): File "main.py", line 75, in <module> calculateHappiness(group) #calculate the most happiest group and pri

我已经编写了一个python(2.7)脚本,但它使用了大量内存,因此出现了内存不足错误。可以使用内存吗

我的代码():

错误:

Searching all the combinations...
Traceback (most recent call last):
  File "main.py", line 75, in <module>
    calculateHappiness(group) #calculate the most happiest group and print
  File "main.py", line 38, in findCombinations
    newGroup = group
MemoryError
正在搜索所有组合。。。
回溯(最近一次呼叫最后一次):
文件“main.py”,第75行,在
计算快乐(组)#计算最快乐的组并打印
FindCompositions中第38行的文件“main.py”
新建组=组
记忆者

我使用的是6 GB内存的64位windows 10。是否可以使用我的硬盘的虚拟ram或磁盘空间?

是否使用64位版本的Python?windows32每个应用程序的内存限制为2gb,这与我的64位/4核/16G开发机器中的错误相同。newGroup.append(listTemp)递归没有结束。当内存从8GB达到10GB且内存未释放时,监视内存使用情况和程序崩溃。我希望避免递归--您正在耗尽堆栈。您是否使用64位版本的Python?windows32每个应用程序的内存限制为2gb,这与我的64位/4核/16G中的错误相同开发机器。newGroup.append(listTemp)recursive without end.monitor内存使用情况和程序崩溃,同时内存从8GB达到10GB,并且内存未释放。我希望避免递归—您正在耗尽堆栈。
Searching all the combinations...
Traceback (most recent call last):
  File "main.py", line 75, in <module>
    calculateHappiness(group) #calculate the most happiest group and print
  File "main.py", line 38, in findCombinations
    newGroup = group
MemoryError