# 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sannybuilder.com/troubleshooting/errors/0091.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
