The ulimit Command

The ulimit command manipulates system resource limits for current and child processes using the following format:

					ulimit [options] 

or

					ulimit [options] n
				

where n indicates to set a resource limit to n (except with the –a option). If n is not given, the specified resource limit is displayed. If no option is given, the default –f (file size limit) is used. Here, all the current resource limits are displayed:

					$ ulimit —a
					time(seconds)    unlimited
					memory(kbytes)   unlimited
					data(kbytes)     4294901761
					stack(kbytes)    2048
					file(blocks)     unlimited
					coredump(blocks) unlimited
				

This command sets the core dump size limit to 500 blocks:

					$ ulimit —c 500
				

To disable generation of core dumps, the dump size should be set to 0 blocks:

					$ ulimit —c 0
				

To display the current file size write limit, use ulimit without arguments:

					$ ulimit
					unlimited
				

Table 9.1 lists the ulimit options. If a size argument is not given, the current limit is displayed.

Table 9.1. ulimit Options
–a displays all the current resource limits
–c n set the core dump size limit to n 512-byte blocks
–d n set the data area size limit to n kilobytes
–f n set the child process file write limit to n 512-byte blocks (default)
–m n set the physical memory size limit to n kilobytes
–s n set the stack area size limit to n kilobytes
–t n set the process time limit to n seconds

The ulimit command is system dependent. Some systems may have different resource limits, and some may not allow changing resource limits. Check your local system documentation for discrepancies.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.208.203