Understanding system limits

Resources on a system tend to be finite and some are more limited than others. This section describes some of the limits on a BlackBerry 10 OS system. Let's start by considering the limits on describing limits.

BlackBerry 10 OS is a microkernel OS, so many things that might be a core limit in some operating systems instead depend on the particular manager that implements that service under BlackBerry 10 OS, especially for file systems, where there are multiple possible file systems.

Many resources depend on how much memory is available. Other limits depend on your target system. For example, the virtual address space for a process can vary by processor from 32 MB on ARM to 3.5 GB on x86.

Some limits are a complex interaction between many things. To quote the simple/obvious limit is misleading; describing all of the interactions can be complicated. The key thing to remember is that there can be many factors behind a limit.

Configurable limits

When you're trying to determine your system's limits, you can get the values of configurable limits, special read-only variables that store system information.

BlackBerry 10 OS also supports configuration strings, which are similar to, and frequently used in conjunction with, environment variables.

You can use the POSIX getconf utility to get the value of a configurable limit or a configuration string. Since getconf is a POSIX utility, scripts that use it instead of hard-coded BlackBerry 10 OS-specific limits can adapt to other POSIX environments.

Some configurable limits are associated with a path; their names start with _PC_. When you get the value of these limits, you must provide the path (see File system limits). For example, to get the maximum length of the filename, type:

getconf _PC_NAME_MAX pathname

Other limits are associated with the entire system; their names start with _SC_. You don't have to provide a path when you get their values. For example, to get the maximum number of files that a process can have open, type:

getconf _SC_OPEN_MAX

In general, you can't change the value of the configurable limits—they're called configurable because the system can set them.

The BlackBerry 10 OS libraries provide various functions that you can use in a program to work with configurable limits:

pathconf()
Get the value of a configurable limit that's associated with a path.
sysconf()
Get the value of a limit for the entire system.
setrlimit()
Change the value of certain limits. For example, you can use this function to limit the number of files that a process can open; this limit also depends on the value of the -F option to procnto .

Last modified: 2014-11-17



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus