Main Content

Dynamic memory allocation threshold

Size above which private variables are allocated on heap instead of stack

Since R2020b

Model Configuration Pane: Code Generation / GPU Code


The Dynamic memory allocation threshold parameter specifies the memory allocation threshold.


  • This parameter requires a GPU Coder™ license.

  • To enable this parameter, select Generate GPU code on the Code Generation pane.


200 (default) | integer

Specify the size above which the private variables are allocated on the heap instead of the stack, as an integer value.

Recommended Settings

DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

Programmatic Use

Parameter: GPUMallocThreshold
Type: integer
Value: any valid value
Default: 200

Version History

Introduced in R2020b