Usage of Linux Shell Command ulimit

Source: Internet
Author: User

1, note:
Ulimit is used for resources occupied by Shell startup processes.
2. Category:
Shell built-in commands
3. Syntax format:
Ulimit [-acdfhlmnpsstvw] [size]
4. Parameter introduction:
-H: Set hardware resource limits.
-S: Set software resource limits.
-A: displays all current resource limits.
-C size: sets the maximum value of the core file. Unit: Blocks
-D size: sets the maximum value of the data segment. Unit: Kbytes
-F size: sets the maximum value of the file to be created. Unit: Blocks
-L size: sets the maximum value of the locked process in the memory. Unit: Kbytes
-M size: sets the maximum value of resident memory that can be used. Unit: Kbytes
-N size: sets the maximum value of the file descriptor that the kernel can open at the same time. Unit: N
-P size: sets the maximum value of the MPs queue buffer. Unit: Kbytes
-S size: sets the maximum value of the stack. Unit: Kbytes
-T size: sets the maximum CPU usage time. Unit: seconds
-V Size: sets the maximum value of virtual memory. Unit: Kbytes
5. Example
When writing a program in Linux, if the program is large, you will often encounter problems such as "segment error" (segmentation fault, this is mainly because the initial stack size (stack size) of the Linux system is too small, generally 10 m. I usually set the stack size to 256 m, so there is no segment error! Command:
Ulimit-s 262140
If you want the system to automatically remember this configuration, edit the/etc/profile file, under the "ulimit-s-c 0>/dev/null 2> & 1" line, add "ulimit-s 262140" and save and restart the system!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.