Why is MATLAB Web App Server's memory consumption high even when no apps are running?

10 views (last 30 days)
I have MATLAB Web App Server installed and configured with several different apps. After starting the server, I found that MATLAB Web App Server's memory consumption was very high even before running any of my deployed web apps.
Why is MATLAB Web App Server's base memory usage so high?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 8 Oct 2025
Edited: MathWorks Support Team on 8 Oct 2025
MATLAB Web App Server maintains several running workers to help improve app startup time, which will consume memory even when no apps are in use. By default, the server prewarms 1/3 of the total maximum number of workers (maximum_sessions) at all times. For example, if a server is configured with maximum_sessions = 12, the server will attempt to maintain 4 prewarmed sessions whenever possible, in addition to any sessions in use. 
There are two configuration options that can be used to limit the number of prewarmed workers:
  • maximum_sessions (MaxWorkers): By default, MATLAB Web App Server prewarms approximately 1/3 of the maximum number of sessions. Increasing the maximum number of sessions using using webapps-config can increase the number of available sessions, both prewarmed and not. Note that it is recommended that you do not increase this value beyond the system requirements described here.
  • MaxPrewarmedWorkers: This value can be set to limit the number of worker sessions prewarmed for a specific runtime version. This can be viewed and set in the "webapps.config" file located in your config folder and is unset by default. You may use this value to reduce prewarming of lesser-used runtimes; for example, if all R2022a web apps on your server are used infrequently, you may set this value to 0 to prevent prewarming of R2022b worker sessions: 
    <Runtime Path="/usr/local/MATLAB/MATLAB_Runtime/v912" MaxPrewarmedWorkers="0"/>
    These apps can still be run by any available non-prewarmed workers, but no sessions will be reserved specifically for R2022b apps. 
Please note that the MaxPrewarmedWorkers configuration is undocumented and may change without notice. It is also not recommended to edit the "webapps.config" directly. Use caution if you choose to follow this workflow.

More Answers (0)

Categories

Find more on Web Apps in Help Center and File Exchange

Tags

No tags entered yet.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!