gpt4 book ai didi

linux - 如何在 Linux 上增加每个虚拟内存?(命令行)

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:09:33 25 4
gpt4 key购买 nike

我只是为每个账户分配一些虚拟内存,

 pi@duckpi01 /etc $ ulimit -v 100
pi@duckpi01 /etc $ ulimit -v 200
-bash: ulimit: virtual memory: cannot modify limit: Operation not permitted
pi@duckpi01 /etc $ ulimit -v 99
pi@duckpi01 /etc $ ulimit -v 101
-bash: ulimit: virtual memory: cannot modify limit: Operation not permitted
pi@duckpi01 /etc $ ulimit -v 100
-bash: ulimit: virtual memory: cannot modify limit: Operation not permitted
pi@duckpi01 /etc $ ulimit -v 200
-bash: ulimit: virtual memory: cannot modify limit: Operation not permitted
pi@duckpi01 /etc $ cd security
pi@duckpi01 /etc/security $ vi limits.conf
Segmentation fault
pi@duckpi01 /etc/security $ sudo ulimit -v 200
Segmentation fault

但是现在我不能使用ulimit 分配超过99 的内存。显然,99kbytes 不足以让我做任何事情。我使用 sudo,但它不起作用。我该如何解决这个问题?

这行不通:

pi@duckpi01 /etc/security $ sudo mount -t tmpfs -o size=2048M tmpfs /media/nameme/
Segmentation fault
pi@duckpi01 /etc/security $ sudo mount -t tmpfs -o size=500M tmpfs /media/nameme/
Segmentation fault

这也行不通:

pi@duckpi01 /etc/security $ sudo ulimit -v unlimited
Segmentation fault
pi@duckpi01 ~ $ sudo su
Segmentation fault
pi@duckpi01 ~ $ mkdir -p /media/nameme
Segmentation fault
pi@duckpi01 ~ $ free -m
Segmentation fault
pi@duckpi01 ~ $ sudo ulimit -v
Segmentation fault
pi@duckpi01 ~ $ ulimit -v
99
pi@duckpi01 ~ $ su -u root
Segmentation fault

不起作用:

pi@duckpi01 ~ $ ulimit -c unlimited
pi@duckpi01 ~ $ ulimit -v
99
pi@duckpi01 ~ $ ulimit -v 10000
-bash: ulimit: virtual memory: cannot modify limit: Operation not permitted
pi@duckpi01 ~ $ ls
Segmentation fault

最佳答案

root 身份登录并重置限制:

su -u root    
ulimit -v unlimited

或者退出当前用户并以 root 身份登录:

logout

关于linux - 如何在 Linux 上增加每个虚拟内存?(命令行),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29960676/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com