Skip to content

erts: Make module and export table limits tunable - #11264

Merged
sverker merged 1 commit into
erlang:masterfrom
naserca:tunable-module-function-limits
Aug 20, 2026
Merged

erts: Make module and export table limits tunable#11264
sverker merged 1 commit into
erlang:masterfrom
naserca:tunable-module-function-limits

Conversation

@naserca

@naserca naserca commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Add the +zmml and +zmel emulator flags to set the maximum number of entries in the module_code and export_list loader index tables, raising the previously hardcoded MODULE_LIMIT (64K) and EXPORT_LIMIT (512K) caps.

Expose the current limits and counts via erlang:system_info/1 with the new module_limit, module_count, export_limit and export_count keys, and document the flags and system_info keys.

Proposed here.

@CLAassistant

CLAassistant commented Jun 18, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

CT Test Results

    3 files    136 suites   50m 58s ⏱️
1 687 tests 1 631 ✅ 56 💤 0 ❌
2 330 runs  2 256 ✅ 74 💤 0 ❌

Results for commit e4d2f99.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@naserca
naserca force-pushed the tunable-module-function-limits branch 2 times, most recently from 9f31602 to 716b215 Compare June 19, 2026 08:07
@IngelaAndin IngelaAndin added the team:VM Assigned to OTP team VM label Jun 22, 2026
@sverker

sverker commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Thank you for a comprehensive PR.

However, I think it would be more useful if system_info for module_limit and export_limit would return the actual effective limit. This is what process_limit and port_limit does, but not atom_limit.

My suggestion is to insert a new commit first that changes the behavior of atom_limit by changing erts_index_init() to set t->limit to the real limit aligned up by INDEX_PAGE_SIZE.

And then mimic erts_get_atom_limit() that returns the set limit of the underlying index table:

Uint erts_get_atom_limit(void)
{
    return erts_atom_table.limit;
}

@naserca

naserca commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

Makes sense, and thanks! Do you want the atom_limit fix in a separate PR? Or just in a separate commit here in this PR?

@naserca

naserca commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Went ahead and opened #11364.

@sverker

sverker commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

#11364 has been merged to master.

@naserca
naserca force-pushed the tunable-module-function-limits branch from 716b215 to 9156837 Compare August 5, 2026 14:46
@naserca

naserca commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @sverker! I've updated this PR.

Comment thread erts/doc/references/erl_cmd.md Outdated
Comment thread erts/doc/references/erl_cmd.md Outdated
Add the +zmml and +zmel emulator flags to set the maximum number of
entries in the module_code and export_list loader index tables, raising
the previously hardcoded MODULE_LIMIT (64K) and EXPORT_LIMIT (512K)
caps.

Expose the current limits and counts via erlang:system_info/1 with the
new module_limit, module_count, export_limit and export_count keys, and
document the flags and system_info keys. As with atom_limit, the reported
limit is the effective one enforced by the underlying index table (the
requested value rounded up to a whole number of pages).
@naserca
naserca force-pushed the tunable-module-function-limits branch from 9156837 to e4d2f99 Compare August 5, 2026 17:54
@sverker sverker added the testing currently being tested, tag is used by OTP internal CI label Aug 6, 2026
@sverker
sverker merged commit c2548e6 into erlang:master Aug 20, 2026
35 checks passed
@sverker

sverker commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

@naserca Thanks for the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants