🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
ModlrLeanLoad
This page was created by Hans.karlsen on 2023-09-05. Last edited by Wikiadmin on 2026-07-29.

ModlrLeanLoad helps administrators of MDriven Turnkey and MDrivenServer start a deployed application faster and with lower memory use when the deployed model has not changed.

ModlrLeanLoad is enabled by default in builds after 2023-09-05. It keeps a reduced local copy of the deployed modlr model so that a later startup can avoid loading the model from the Admin database and processing its assets again.

What ModlrLeanLoad creates

ModlrLeanLoad stores these files in the application's App_Data directory:

File Purpose
ModlrLeanLoadChecksum.xml Stores the checksum for the reduced model file. MDrivenServer compares this value with the checksum of the current deployed model.
ModlrLeanLoadModel.modlr Stores the reduced model that can be used for a later startup when the checksum matches.

The reduced ModlrLeanLoadModel.modlr does not contain the AssetsTK folder or its content. It also has diagrams removed, except state diagrams. This avoids both asset checking and the memory use that those assets would otherwise cause during a matching startup.

From version 23.11.11, ViewModel content in the reduced model can be incomplete. ViewModels are instead handled by the Softview strategy.

How startup chooses a model

At startup, MDrivenServer checks whether ModlrLeanLoadChecksum.xml exists and whether its checksum matches the current model in MDrivenServer.

Condition Startup behavior
The checksum file exists and matches the current model MDrivenServer loads ModlrLeanLoadModel.modlr. It does not load the model from the Admin database. Because the reduced file has no AssetsTK content, the server does not spend time checking those assets and they do not add memory pressure.
The checksum file is missing, or its checksum does not match the current model MDrivenServer performs the normal model load from the Admin database. It checks AssetsTK, distributes AssetsTK and CodeDress as required, then creates a new checksum file and a new reduced ModlrLeanLoadModel.modlr.

For example, after an application has started with a newly uploaded model, MDrivenServer creates the reduced local files. If you restart the application without uploading another model, the checksum matches and the next startup uses the reduced model. If you upload a changed model, the checksum no longer represents the current model, so the server performs a normal load and rebuilds the reduced files.

How this works with Softview

When MDriven Turnkey or MDrivenServer detects a new model, it expands the complete model into App_Data/ModlrLeanComplete. Softview uses that location to load ViewModels on demand and to detect updated ViewModel files.

This complements ModlrLeanLoad:

  • ModlrLeanLoad reduces startup work and memory use by keeping a reduced model for unchanged deployments.
  • Softview keeps only ViewModels that users request in memory after later starts, and allows you to update a deployed ViewModel file without uploading a new model and restarting the application.

Only ViewModel *.span files in App_Data/ModlrLeanComplete are read at runtime by Softview. Changes to other files in that folder are ignored and do not change application behavior. See Documentation:Softview for the Softview workflow and its limitations.

Rebuild the reduced model

Use this procedure when you need the application to create a fresh reduced model on its next startup.

  1. Stop the application, or otherwise ensure that the next action occurs before its next startup.
  2. Open the application's App_Data directory.
  3. Delete ModlrLeanLoadChecksum.xml.
  4. Start the application.
  5. MDrivenServer cannot use the previous reduced model because its checksum file is absent. It performs a normal model load and then creates a new ModlrLeanLoadChecksum.xml and ModlrLeanLoadModel.modlr.

You do not need to delete ModlrLeanLoadModel.modlr to force this behavior; deleting the checksum file is the trigger described above.

Important limitations

  • Do not treat ModlrLeanLoadModel.modlr as a complete deployable model. It is intentionally reduced.
  • Diagrams are stripped from the reduced file, except state diagrams.
  • Do not expect all ViewModel content to be present in the reduced file. ViewModel loading follows the Softview strategy.
  • A model change causes a normal load before ModlrLeanLoad can create a new reduced copy. The faster path is for subsequent starts where the deployed model is unchanged.

See also