页面文件使用
我运行一个在文件系统上进行文本操作的脚本。
该脚本在文本文件(.h、.cpp)上运行。
当脚本运行时,我看到 PF 使用量不断增加,直到达到为页面文件分配的 VM 数量。
有没有办法在运行期间或之后刷新虚拟机?
我已经提出了另一个关于它的问题(认为这是不同的问题): 单个 sed 命令用于多个替换?
I run a script which does text manipulation on the files system.
The script runs on text files ( .h, .cpp ).
As the script runs i see that the PF usage increases up until it reaches the amount of VM allocated for the page file.
Is there a way to flush the VM during the run or after it?
I have opend another question regarding it ( thought it was different issue ):
Single sed command for multiple substitutions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
分块或批处理您的操作,以便您可以更有效地使用内存,而不是仅仅将所有内容加载到内存中。如果您的文件都不是很大,请限制将文本从这些文件加载到内存中的线程数。如果使用大文件,请将它们分解,以便利用您拥有的内存更有效地处理它们。
Chunk or batch your operations so that you can use your memory more efficiently instead of just loading everything into memory. If none of your files are large, limit the number of threads that load text from these files into memory. If using large files, break them up to process them more efficiently using the memory you have.
不,但也许您可以更改脚本以消耗更少的内存。
更新。我尝试在Linux上重现该问题,对应于
其他问题中列出的脚本。在 Bash 中:
我使用了蛋白质序列数据库的片段(大文本文件,FASTA 格式,最大 74 MB)和短肽序列进行测试(这样每个文件至少有 10 个替换)。
当它运行时,没有进程使用任何重要的内存(正如我所期望的)。 CPU负载
运行时约为 50%。因此我无法重现该问题。
No, but maybe you can change the script to consume less memory.
Update. I have tried to reproduce the problem on Linux, corresponding to
the script listed in the other question. In Bash:
I have used fragments of a protein sequence database (large text file, FASTA format, up to 74 MB) and short peptide sequences for the test (such that there was at least 10 replaces per file).
While it is running no process is using any significant memory (as I would expect). CPU load
is on the order of 50% while it is running. Thus I can not reproduce the problem.
页面文件是系统资源,任何用户进程都不能操作。在这种情况下,页面文件大小增加只是应用程序问题的症状 - 应用程序超出了提交限制。你必须处理问题,而不是症状。
The pagefile is a system resource and can not be manipulated by any user process. In this case the pagefile increasing in size is simply a symptom of an application problem - the application is exceeding the commit limit. You must deal with the problem, not the symptom.