Borrar filtros
Borrar filtros

Why does my stand-alone created using the MATLAB Compiler take longer to start the first time?

7 visualizaciones (últimos 30 días)
It takes longer to start my stand-alone application the first time it is run than consecutive runs. Also if I run the application some time later, it again takes longer the first time but becomes faster on consecutive runs. I would expect it to always start quicker after the first run.

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 18 de Jul. de 2024 a las 0:00
Editada: MathWorks Support Team el 18 de Jul. de 2024 a las 8:11
The time improvement is expected behavior and is an optimization done by the operating system. This behavior is typical of all programs. When a program starts, it needs to be loaded from a slow medium (hard disk), to a fast medium (RAM). When a program stops running, the code for the program is not removed immediately; instead it is removed when a page fault occurs:
Page fault
See also:
Locality of reference
Since a machine does not have infinite memory, the code in memory is removed once another program needs it. If you restart your compiled application immediately, the code is already in memory and does not need to be reloaded from disk, so it's fast. If it has already been removed from memory, then in needs to be reloaded from the disk.
This is all normal operating system behavior. For more detailed information, refer to literature regarding operating systems.

Más respuestas (0)

Categorías

Más información sobre Manage Products en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by