문제

Good day!

I have a perl script, that consome a lot of memory ( 3-4 Gb ). Can I get that script to use only swap memory? ( I use ubuntu )

Thanks.

도움이 되었습니까?

해결책

You might be able to increase the "swappiness" of your processes using cgroups - See: Documentation/cgroups/cgroups.txt. cgroups are control groups, via which you can give families of related processes specific characteristics. Section 1.6 of that document shows how to set up such a group.

Having established a cgroup you can set it's swappiness (ie. how soon the kernel will start swapping it relative to other processes in the system). See: Documentation/cgroups/memory.txt.

Disclaimer: I have not had occasion to use this function yet so the above is from glancing through these documents. You'd better read them carefully before you try to use them!

다른 팁

If your script consumes a lot of memory and doesn't fit into physical memory, you need a disk swap. If disk swap is not what you what you may turn it off using swapoff. But if you do this, then your script will simply fail if it attempts to allocate more memory than physically available. I'd suggest to optimize script memory consumption.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top