Matlab:使用parallel_function时出错:内存不足 [英] Matlab: Error using parallel_function: Out of Memory

查看:1323
本文介绍了Matlab:使用parallel_function时出错:内存不足的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 7 64位,Core i7 CPU和8 GB RAM上使用Matlab R2011b版本.我正在运行使用Matlabpool的称为Locality Sensitive Hashing的近似最近邻居算法.启动Matlab池后,我得到了输出

I am using Matlab R2011b version on Windows 7 64 bit, Core i7 CPU with 8 GB RAM. I am running Approximate Nearest Neighbor algorithm called the Locality Sensitive Hashing using Matlabpool. Upon starting Matlab pool, I get the output

Starting matlabpool using the 'local' configuration ... connected to 4 labs.

当控件到达for循环时,Matlab抛出错误

When the control reaches the for loop, Matlab throws errro

Error using parallel_function (line 598)

Out of memory. Type HELP MEMORY for your options.

Error stack:
remoteParallelFunction.m at 29

Error in Evaluate (line 19)
parfor i=1:query_num

我不知道如何解决这个问题.请帮忙.谢谢

I have no clue how to solve this problem. Please help. Thank you

推荐答案

这是因为parfor需要更多的内存.

That is because the parfor requires a lot more memory.

parfor循环中的所有工作程序/实验室都是独立的,因此每个工作人员/实验室都需要自己的内存量.另外,由于池必须散布和从/向工作人员收集数据,因此会涉及开销.

All the workers/labs in a parfor loop are independent so each of them needs his amount of memory. Also, there is overhead involved due to the fact that the pool must spread and collect data from/to the workers.

尝试使用常规的for或由2名工人(而不是4名)打开游泳池.

Try using a regular for or open a pool with 2 workers instead of 4.

此外,这还取决于some_function()的优化程度:尝试使用尽可能少的变量.

Also, it depends on how optimized your some_function() is: try using as few variables as possible.

这篇关于Matlab:使用parallel_function时出错:内存不足的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆