bash:由于查找结果循环而导致记忆不足
我的bash脚本在以下点返回xrealloc:不能分配1844444444071562067968字节
:
for file in $(find "$BUFFER/tmpFilesArchives" -type f)
do
extract_VMs
done
folder $
$ buffer/tmpfilesarchives
包含大约。 50.000文件。该机器的内存约为128GB。
是否有更好的(即保存内存)方法可以通过查找结果进行循环?
我正在尝试以下一个,但也破裂了。
while IFS= read -r -d '' file; do
extract_VMs
done < <(find "$BUFFER/tmpFilesArchives" -type f)
提前致谢。
My bash script fails at the below point returning xrealloc: cannot allocate 18446744071562067968 bytes
:
for file in $(find "$BUFFER/tmpFilesArchives" -type f)
do
extract_VMs
done
The folder $BUFFER/tmpFilesArchives
contains approx. 50.000 files.The machine has around 128GB of memory.
Is there a better (i.e. memory-saving) approach to loop through the results of find?
I was trying the below one but it also breaks.
while IFS= read -r -d '' file; do
extract_VMs
done < <(find "$BUFFER/tmpFilesArchives" -type f)
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论