Solaris 11.4 - Oracle ZFS Buffer Cache and App Memory Hints
Solaris has long used the UFS File System as the default for root disks. This filesystem placed I/O buffers in the "free space", causing misleading performance problems for Disk I/O when there was seemingly plenty of memory left. This was remedied by ZFS, where disk I/O buffers are counted as used buffer, truly showing only "wasted" memory as free memory. This causes a problem for some applications (i.e. Oracle RDBMS Installers), which attempt to determine how much free space is available before performing an application installation. There is a "work around" for these broken applications.
An excellent document to understand the use of memory is available from Oracle:
Memory Management Between ZFS and Applications in Oracle Solaris 11.x (Doc ID 1663862.1)
It is not the objective of this blog to re-explain this document, merely show what has not been included by Oracle, for manually making adjustments to the memory usage.
Determining Memory Usage:
One can determine the memory available for any version of Solaris with:
And determine the usage by different aspects of Solaris with:
Note: 5.6% is wasted memory, out of the 32Gig total, but some 23.4G /73% can be used, if requested.
The application must request the memory, for it to be available, if it can not interrogate now much it can request from the kernel.
What to Do if an App Fails to Start
Option 1: Reboot
If an application fails to start, like an Oracle RDBMS Installer, because it is not smart enough to determine most of the memory is free, you can temporarily flush the ZFS Adaptive Read Cache (ARC) by rebooting the boot.
The system will flush the cache and there will be plenty of memory available for the installer.
Option 2: Dynamically Tune
Oracle Solaris 11.4 created a new tunable called "user_reserve_hint_pct", which requests the OS to dynamically reserve a percentage of the memory for the application by flushing the ARC.
There is a danger: do not reserve more memory for the user processes than the Kernel & OS require!
Step 1: Determine default value (should be 0)
Step 2: Select value from determined memory usage (ZFS 73 - Free 5.6 = ~67%, round down 65%)
Step 3: Revert Value to Default since much of the the ARC cache has been flushed.
At this point, the application should be able to be dynamically tuned.
Oracle Solaris provides an incredibly tunable environment for running applications, including legacy applications, which are not quite smart enough to understand the benefits of the underlying OS.