简体   繁体   English

Python 2.7中的MemoryError

[英]MemoryError in python 2.7

I m running a python program that consume a large memory, I have 64bit windows 7 OS and 4 GB of RAM, still when the private bytes for my program reaches about 1.5GB it genearates the MemoryError. 我正在运行一个消耗大量内存的python程序,我具有64位Windows 7 OS和4 GB RAM,但是当我程序的专用字节达到约1.5GB时,仍会产生MemoryError。 Is there any solution to get more RAM for the program ? 有什么解决方案可以为程序获取更多的RAM? or please help me through other solutions 或者请通过其他解决方案帮助我

Though I have not tried it but I think this should help. 尽管我还没有尝试过,但是我认为这应该有所帮助。 Just try to increase the virtual memory size and see the effect if it resolve. 只需尝试增加虚拟内存的大小,然后看效果是否可以解决。 Here is the explanation . 这是解释 Give it a go if you have time to test. 如果您有时间测试,请尝试一下。

To change the virtual memory size follow these instructions : 要更改虚拟内存大小,请按照以下说明进行操作

  1. Open System by clicking the Start button, right-clicking Computer , and then clicking Properties . 单击“ 开始”按钮,右键单击“ 计算机” ,然后单击“ 属性” ,打开“系统”。

  2. In the left pane, click Advanced system settings . 在左侧窗格中,点击高级系统设置 If you're prompted for an administrator password or confirmation, type the password or provide confirmation. 如果系统提示您输入管理员密码或确认,请键入密码或提供确认。

  3. On the Advanced tab, under Performance , click Settings . 在“ 高级”选项卡上的“ 性能 下,单击“设置”

  4. Click the Advanced tab, and then, under Virtual memory , click Change . 单击高级选项卡,然后在虚拟内存下单击更改

  5. Clear the Automatically manage paging file size for all drives check box. 清除“ 自动管理所有驱动器的页面文件大小”复选框。

  6. Under Drive [Volume Label] , click the drive that contains the paging file you want to change. 在“ 驱动器[卷标]”下 ,单击包含要更改的页面文件的驱动器。

  7. Click Custom size , type a new size in megabytes in the Initial size (MB) or Maximum size (MB) box, click Set , and then click OK . 单击“ 自定义大小” ,在“ 初始大小(MB)”或“ 最大大小(MB)”框中键入新的大小(以兆字节为单位 ,单击“ 设置” ,然后单击“ 确定”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM