If you’re asking, “How do I clear ZFS cache on TrueNAS?”, the short answer is that TrueNAS does not normally need a manual cache clear. ZFS uses available memory for its Adaptive Replacement Cache (ARC), then releases memory when the system or applications need it. High memory use by itself is usually expected—not a sign that the cache is stuck or that your data is at risk.
If you need to start with a temporarily empty ARC for troubleshooting, restarting TrueNAS is the simplest reliable option. The cache will begin filling again as files are accessed. Before restarting, make sure no important tasks are running and that you understand the impact on services hosted by the system.
What the ZFS Cache Does in TrueNAS
ZFS uses ARC to keep frequently accessed data and metadata in memory. When you read a file from a pool, ZFS may retain some of its contents in ARC so a later read can be served more quickly. ARC can also cache metadata, such as information about files and directories, which helps ZFS work efficiently.
On systems with a suitable cache device, ZFS may also use a Level 2 Adaptive Replacement Cache, or L2ARC. This is a secondary cache, typically stored on an SSD or another fast device. L2ARC supplements ARC; it does not replace system memory, and it is not a backup of your pool.
These caches are designed to use resources when they are available. As a result, the amount of memory reported as used can look high even when TrueNAS is operating normally. The more useful question is whether the system can meet the memory needs of its services and workloads—not whether ARC is small.
Is It Safe to Clear the ZFS Cache?
In general, yes, but it is rarely necessary. Clearing or reducing the cache does not repair a pool, delete cached files from your datasets, or make stored data safer. It simply means ZFS may need to read data from the pool again rather than serving it from memory or a cache device.
After a cache reset, the first access to files may be slower. Performance can improve again as frequently used data is read and cached. If the original concern is low available memory, a reset may only provide temporary relief. It is better to check for a workload, application, or configuration that is consuming more memory than expected.
Do not remove a device or change a pool layout just to clear ARC. Also, never remove a data vdev thinking it is a cache device. Pool devices have different roles, and removing the wrong one can put data at risk.
How to Clear ZFS ARC on TrueNAS
There is no standard “Clear ZFS Cache” button in the TrueNAS web interface. For a straightforward temporary reset, restart the system from the web interface or use the appropriate normal shutdown and startup procedure for your installation.
- Check that backups, replication, scrubs, and other important jobs are not in progress.
- Stop or safely shut down applications and virtual machines if your setup requires it.
- Use the TrueNAS interface to restart the system, or follow your organization’s approved maintenance procedure.
- After TrueNAS starts, allow the system to settle and check performance before deciding whether there is still a problem.
A restart clears the in-memory ARC because the operating system is restarted. It does not erase pool data. Once the system is running again, ZFS will build the cache naturally as users and services access data. This is why memory use may rise again soon after reboot; that behavior is usually normal.
Check ARC Usage Before Taking Action
It helps to look at ARC statistics before restarting. In the TrueNAS web interface, open the Shell, or connect using an authorized SSH account if SSH is enabled. The exact commands and available tools vary between TrueNAS CORE and TrueNAS SCALE versions, so treat command output as diagnostic information and avoid changing system settings unless you understand the consequences.
On many TrueNAS SCALE systems, you can inspect the ARC statistics file with:
cat /proc/spl/kstat/zfs/arcstats
On TrueNAS CORE, ZFS statistics are commonly available through the system control interface. For example, you may be able to view ARC-related values with:
sysctl kstat.zfs.misc.arcstats
Some installations also provide tools such as arc_summary or arcstat. These can help show how much ARC is in use, how often requests are being served from the cache, and whether the cache is changing over time. Tool availability depends on the TrueNAS release and environment.
Statistics are most useful when you compare them over time and alongside system performance. A large ARC allocation is not automatically a problem. Look for symptoms such as applications being terminated, persistent swapping, slow or unresponsive services, or memory pressure that affects other workloads.
What About the Linux Drop-Caches Command?
Instructions online sometimes recommend running echo 3 > /proc/sys/vm/drop_caches on Linux. This is a Linux memory-management command that requests the release of certain filesystem caches and reclaimable data. It is not a TrueNAS web-interface feature, and it should not be treated as a guaranteed, supported way to completely reset ZFS ARC.
Its effect can vary depending on the kernel, OpenZFS version, and system state. It can also make subsequent reads slower while caches are rebuilt. Avoid running commands as root just because they appear in a forum post, especially on an appliance-like storage system. If you are troubleshooting a specific issue, use the TrueNAS documentation for your release or contact iXsystems or a qualified administrator before making changes.
In particular, do not attempt to write directly to internal ZFS statistics files. They are generally for reporting, not for issuing a cache-clear command. A command that works on one Linux distribution or OpenZFS release may not be appropriate for another TrueNAS version.
How to Think About L2ARC
If by “ZFS cache” you mean an SSD or other device shown as a cache vdev, that is L2ARC rather than the in-memory ARC. L2ARC can help certain workloads, but it is not required for every TrueNAS pool. For many systems, adding memory or addressing the workload is more useful than adding a cache device.
You generally do not need to clear L2ARC as routine maintenance. If you need to change or remove an L2ARC device, first confirm its role in the pool status view. Use the TrueNAS interface and the documentation for your version, and verify that the device is labeled as a cache device—not a data or log device—before making changes.
Removing a cache device is different from removing a data vdev, but the action can still affect performance and should be planned. Do not unplug an SSD or detach a device based only on its physical appearance or connection. Confirm the device identity and pool role in the interface, and ensure you have current backups before any storage change.
Changing Cache Behavior Is Not the Same as Clearing It
ZFS dataset properties can influence whether data or metadata is eligible for caching. For example, properties such as primarycache and secondarycache control aspects of ARC and L2ARC use. Changing these settings affects caching behavior; it is not a simple one-time flush of existing cache contents.
Changing cache properties without understanding the workload can reduce performance. A setting that is appropriate for a database, virtual machine, or streaming workload may not suit general file storage. If you are considering a change, review the dataset’s role and consult TrueNAS and OpenZFS documentation for your installed version. Do not apply a setting across all datasets as a quick fix for high memory use.
When Clearing ARC May Help
A restart that empties ARC can be useful as a controlled troubleshooting step. For example, an administrator may want to compare cold-cache and warm-cache performance, investigate unusual application behavior, or determine whether a temporary condition changes after a reboot. Record relevant system metrics first so you can compare results rather than relying on memory alone.
If a restart appears to solve a problem only briefly, investigate the underlying cause. Check system reporting, application logs, virtual machine and container memory limits, and any recent configuration changes. Also confirm that the system has enough memory for its pool, services, and workload. Clearing cache repeatedly can hide symptoms without fixing the cause.
Common Myths About TrueNAS ZFS Cache
- “ARC uses all my RAM, so something is broken.” Not necessarily. ZFS uses available memory for caching and can release it when needed.
- “Clearing cache will free memory permanently.” It may reduce cache use temporarily, but ARC will grow again as data is accessed.
- “Cache contents are my only copy of the data.” ARC and L2ARC are performance features, not substitutes for pool storage or backups.
- “A cache SSD can be removed like any drive.” First identify its pool role and follow the correct TrueNAS procedure. Never guess which device is safe to remove.
Conclusion
To clear ZFS cache on TrueNAS, the simplest reliable method for resetting in-memory ARC is a normal system restart. There is no standard cache-clear button in the web interface, and high ARC usage is often expected. Check ARC statistics and overall system behavior before taking action, since a large cache alone does not indicate a fault.
For L2ARC or dataset cache settings, use the TrueNAS interface and version-specific documentation rather than removing devices or changing properties blindly. If memory pressure or poor performance persists after a restart, investigate the workload and system configuration instead of repeatedly flushing cache. ZFS cache is there to improve performance, and in most cases it is best to let TrueNAS manage it automatically.
Disclaimer: Articles are written by Humans, AI or Both. Verify Important information.