Home  >  Article  >  Operation and Maintenance  >  Will Linux memory be limited?

Will Linux memory be limited?

WBOY
WBOYOriginal
2022-08-18 16:02:032864browse

Linux memory will be limited; when migrating applications from the root user to an ordinary user, since the ordinary user will be limited to the maximum number of processes, when the number of processes is full, a memory limit error will occur. You can use "grep memlock /etc/security/limits.conf" command to view memory usage limits.

Will Linux memory be limited?

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

Linux memory will be limited

Linux memory common commands

# 查看内存使用情况
free -m
# 查看内存使用限制
grep memlock /etc/security/limits.conf
# 查看SWAP使用积极度
cat /proc/sys/vm/swapiness
# 查看内存回收阈值
grep -A 3 'pages free' /proc/zoneinfo
# 查看内核分配策略
cat /proc/sys/vm/overcommit_memory
# 在分配策略为2的情况下查看可分配内存
grep Com /proc/meminfo

Linux ordinary users will be limited by memory The problem

Migrate the application from the root user to the ordinary user test. Since the ordinary user will be limited to the maximum number of processes, when the number of processes is full, the following error occurs

/bin/bash: Resource temporarily unavailable.

Generally, the maximum number of processes for a new user is 4096

Will Linux memory be limited?

Edit two files

yanfa_ylcloud_java is what you want Users who increase the process

vi /etc/security/limits.d/20-nproc.conf

Will Linux memory be limited?

vi /etc/security/limits.conf

Will Linux memory be limited?

hard/soft: soft is a warning value, while hard is a real valve value, an error will be reported if it exceeds the value.

nproc: Maximum number of processes

nofile: Maximum number of open files

Recommended learning: Linux video tutorial

The above is the detailed content of Will Linux memory be limited?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn