This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Troubleshoot Target Computer Stack Size

I want to find the optimum amount of target computer memory to use for the stack.

What This Issue Means

The stack size on the target computer affects real-time application performance. For some applications, it is important to analyze the current available stack size and minimum available stack size, so that you can adjust the stack size for the application.

Try This Workaround

To discover and adjust the stack size used by the real-time threads on the target computer:

  1. Add these blocks to your model:

    • Current Available Stack Size — Outputs the number of bytes of stack memory currently available to the real-time application thread.

    • Minimum Available Stack Size — Outputs the number of bytes that have not been used in the stack since the thread was created.

      The block traverses the entire stack at every time step to find and report unused bytes. Use Minimum Available Stack Size only for diagnostic purposes.

  2. Execute the real-time application, monitoring the stack size and minimal stack size.

  3. Calculate a stack size that allows execution to proceed.

    Target computer memory for the real-time application executable, the kernel, and other uses is limited to a maximum of 4 GB.

  4. Adjust the stack size of the real-time threads by using a TLCOptions setting.

    For example, to set the stack size for real-time application xpcosc to 4096 kBytes, in the MATLAB® Command Window, type:

    set_param('xpcosc','TLCOptions','-axPCModelStackSizeKB=4096')

See Also

| |