# 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](https://docs.sannybuilder.com/scm-documentation/gta-limits) 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](https://docs.sannybuilder.com/language/data-types/variables) and [arrays](https://docs.sannybuilder.com/language/data-types/arrays) 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](https://docs.sannybuilder.com/editor/options/general#ranges-check)" option.
