Overview
It may be noticed that a Spotfire Web Player running on Linux continues to report elevated memory usage after dashboards are closed and no active analysis is visible. This behavior can differ from what is observed on Windows systems and may raise concerns about memory not being released.
This article explains why this behavior is expected on Linux, what memory the Spotfire Web Player UI reports, and why Linux and Windows exhibit different memory usage patterns.
Memory reported by the Spotfire Web Player UI
The Spotfire Web Player UI reports memory usage based on the operating system’s view of the process memory. This value broadly corresponds to the process working set, which includes:
Memory actively in use by the application
Memory reserved or retained by the runtime for future allocations
Memory used by internal components that remain loaded even when no dashboards are open
This metric does not represent only the memory currently required by open analyses.
Memory behavior after closing dashboards
When a dashboard is closed:
Analysis data and related runtime objects are released by the Spotfire application
The .NET runtime may keep previously allocated memory committed to the process
The Linux operating system does not immediately reclaim this memory from the process
This retained memory remains available for reuse by the Web Player and can be reused efficiently when a new dashboard is opened.
As a result, the memory value reported by the UI may remain unchanged or may continue to increase slightly due to background activity, even when the Web Player appears idle.
Linux memory management characteristics
Linux is designed to prioritize performance and memory reuse. Memory that has been allocated to a process is commonly retained rather than returned to the operating system immediately. This allows future allocations to occur without additional system overhead.
Although the memory appears “used” from a reporting perspective, it is available for reuse either by the same process or, if required, by the operating system under memory pressure.
This behavior is normal and does not indicate a memory leak.
Differences compared to Windows
Windows and Linux manage process memory differently:
Windows more aggressively returns unused memory to the operating system
Linux tends to retain memory within the process for reuse
Because of this, memory usage reported for the same Spotfire workload may appear to decrease on Windows but remain stable or increase on Linux, even though application behavior is comparable.
jemalloc – Improving memory efficiency and performance
Spotfire 14.6 and later (as well as Spotfire 14.0.6 with manual configuration) can use jemalloc, a high-performance memory allocator, to optimize memory behavior on Linux systems. jemalloc acts as an intermediary between the .NET runtime and the operating system, controlling how memory is allocated, reused, and returned to the system.
How jemalloc works
When Spotfire is done with some data, the .NET runtime frees it.
jemalloc decides whether to keep that memory ready for later or return it to the operating system immediately.
This helps reduce the memory reported as “in use,” especially when the Web Player is idle.
This is enabled by default on Spotfire Web Player 14.6 or higher. For Spotfire 14.0.6 the following changes can implement the jemalloc memory allocator
Enabling jemalloc in Spotfire 14.0
1. Install the jemalloc library packages
sudo apt install -y libjemalloc2 libtcmalloc-minimal4
2. On the Web Player machine, find the file Spotfire.Dxp.Worker.Host.sh which will be in a path similar to<installation dir>/webworker-net-core-xxx/Spotfire.Dxp.Worker.Host.sh
3. Uncomment this line so that libjemalloc.so.2 is enabled. Also uncomment the line so that MALLOC_ARENA_MAX is active.
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2
#export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4
# This or similar may also be useful:
export MALLOC_ARENA_MAX=2
4. Restart the web player service
Once this change has been implemented, the Working Set will be clear much quicker, as jemalloc aggressively returns idle memory back to the operating system.
Comments
0 comments
Article is closed for comments.