> For the complete documentation index, see [llms.txt](https://docs.sannybuilder.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sannybuilder.com/troubleshooting/errors/0091.md).

# 0091: Not enough memory to allocate a local variable

The compiler fails to allocate an index for a new local variable. There is a [limit](/scm-documentation/gta-limits.md) to the number of variables that can be used within a script. Exceeding this limit will result in a run-time error.

This limitation applies to both individual [variables](/language/data-types/variables.md) and [arrays](/language/data-types/arrays.md) declarations.

**Possible solutions:**

* Optimize your script. Review your script's logic and attempt to use fewer variables. This can involve reusing variables when possible and eliminating redundant declarations.
* Disable the "[Ranges check](/editor/options/general.md#ranges-check)" option.
