# Configurable limits in Dialyzer

**URL:** <https://erlangforums.com/t/configurable-limits-in-dialyzer/4837>\
**Category:** Proposals: Ideas\
**Tags:** erlang-otp, dialyzer\
**Created:** [June 17, 2025, 11:27pm UTC](https://erlangforums.com/t/configurable-limits-in-dialyzer/4837 "2025-06-17T23:27:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![roman](https://erlangforums.com/letter_avatar_proxy/v4/letter/r/ed8c4c/32.png) [@roman](https://erlangforums.com/u/roman)\
**Post date:** [June 17, 2025, 11:27pm UTC](https://erlangforums.com/t/configurable-limits-in-dialyzer/4837/1 "2025-06-17T23:27:46Z")

</div>

Dialyzer uses hardcoded values for limits, which are not always desirable. It would be very useful to be able to overwrite them one way or another. I believe os environment variables with the same names are the acceptable approach here. Replacing all reference to the ?MACROS with function calls, so if they aren’t defined it falls back to previous behavior:

```erlang
get_set_limit() ->
    case os:get_env(SET_LIMIT) of
        false -> ?SET_LIMIT;
        Limit -> Limit
    end.

```

erl\_types.erl includes the following:

````erlang
%%-----------------------------------------------------------------------------
%% Limits
%%

-define(REC_TYPE_LIMIT, 2).
-define(EXPAND_DEPTH, 16).
-define(EXPAND_LIMIT, 10000).

-define(TUPLE_TAG_LIMIT, 5).
-define(TUPLE_ARITY_LIMIT, 8).
-define(SET_LIMIT, 13).
-define(MAX_BYTE, 255).
-define(MAX_CHAR, 16#10ffff).

-define(UNIT_MULTIPLIER, 8).

-define(MAX_TUPLE_SIZE, (1 bsl 10)).```
````
