The Oracle Solaris kernel memory allocator distributes chunks of memory for use by clients inside the kernel. The allocator creates a number of caches of varying size for use by its clients. Clients can also request the allocator to create a cache for use by that client (for example, to allocate structures of a particular size). Statistics about each cache that the allocator manages can be seen by using the kstat -c kmem_cache command.
Occasionally, systems might panic because of memory corruption. The kernel memory allocator supports a debugging interface (a set of flags), that performs various integrity checks on the buffers. The kernel memory allocator also collects information on the allocators. The integrity checks provide the opportunity to detect errors closer to where they actually occurred. The collected information provides additional data for support people when they try to ascertain the reason for the panic.
Use of the flags incurs additional overhead and memory usage during system operations. The flags should only be used when a memory corruption problem is suspected.
Five supported flag settings are described here.
0 (disabled) or 1 - 15 or 256 (0x100)
Yes. Changes made during runtime only affect new kernel memory caches. After system initialization, the creation of new caches is rare.
When memory corruption is suspected
If the kmem_stackinfo variable is enabled in an /etc/system.d/file at kernel thread creation time, the kernel thread stack is filled with a specific pattern instead of filled with zeros. During kernel thread execution, this kernel thread stack pattern is progressively overwritten. A simple count from the stack top until the pattern is not found gives a high watermark value, which is the maximum kernel stack space used by a kernel thread. This mechanism allows the following features:
Compute the percentage of kernel thread stack really used (a high watermark) for current kernel threads in the system
When a kernel thread ends, the system logs the last kernel threads that have used the most of their kernel thread stacks before dying to a small circular memory buffer
0 (disabled) or 1 (enabled)
When you want to monitor kernel thread stack usage. Keep in mind that when kmem_stackinfo is enabled, the performance of creating and deleting kthreads is decreased. For more information, see Oracle Solaris Modular Debugger Guide.
This parameter must be set in the global zone.