[erlang-questions] limit on ets:select/3

Sverker Eriksson <>
Wed Apr 7 11:12:02 CEST 2010

Ulf Wiger wrote:
> By chance, I stumbled upon this particular limitation in ets:select/3:
> ** exception exit: badarg
>      in function  ets:select/3
>         called as ets:select(16400,[{{'$1'},[],['$1']}],628091364)
> It seems as if the upper bound for the select limit is 134217727,
> that is, no bignums accepted.
> It's not a practical problem in my case, and I can feel that it's
> justified, but is it documented anywhere?
Yes, the BIF (ets_select_3) throws badarg if Limit is a bignum. The 
reference documentation does not mention any bounds on Limit.

Not sure what the best solution is:
1. Document the current behavior, an upper bound that depends on 
architecture (32 or 64 bit).
2. Enforce the same upper bound on 64-bit as the current on 32-bit and 
document that.
3. Remove the badarg and instead continue with the upper bound as Limit 
and document that.
4. Combine 2&3.
5. Any other ideas...

/Sverker, Erlang/OTP

More information about the erlang-questions mailing list