- maximum_sessions (MaxWorkers): By default, MATLAB Web App Server prewarms approximately 1/3 of the maximum number of sessions. If maximum_sessions is left unset, MATLAB Web App Server will assume 1 session per gigabyte (GB) of RAM by default. You can change the maximum number of sessions using using webapps-config. 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: These apps can still be run by any available non-prewarmed workers, but no sessions will be reserved specifically for R2022b apps.<Runtime Path="/usr/local/MATLAB/MATLAB_Runtime/v912" MaxPrewarmedWorkers="0"/>
Why is MATLAB Web App Server's memory consumption high even when no apps are running?
16 views (last 30 days)
Show older comments
MathWorks Support Team
on 7 Mar 2022
Edited: MathWorks Support Team
on 30 Dec 2025 at 14:41
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
about 15 hours ago
Edited: MathWorks Support Team
1 minute ago
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:
Note that while prewarmed workers do consume some amount of memory, their memory consumption often remains relatively low after startup -- in many cases, less than 25MB per prewarmed worker. However, if you are maintaining a large number of prewarmed sessions, this may still add up to a notable impact.
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.
0 Comments
More Answers (0)
See Also
Categories
Find more on MATLAB Web App Server in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!