Skip to content

erts: Make module and export table limits tunable#11264

Open
naserca wants to merge 1 commit into
erlang:masterfrom
naserca:tunable-module-function-limits
Open

erts: Make module and export table limits tunable#11264
naserca wants to merge 1 commit into
erlang:masterfrom
naserca:tunable-module-function-limits

Conversation

@naserca

@naserca naserca commented Jun 18, 2026

Copy link
Copy Markdown

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   52m 3s ⏱️
1 682 tests 1 626 ✅ 56 💤 0 ❌
2 324 runs  2 250 ✅ 74 💤 0 ❌

Results for commit 824356b.

♻️ 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 from 824356b to 9f31602 Compare June 19, 2026 07:33
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.
@naserca naserca force-pushed the tunable-module-function-limits branch 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;
}

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants