Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

erts: Fix ets memory calculation for read_concurrency #5494

Merged

Conversation

garazdawi
Copy link
Contributor

The amount of memory used for reader groups can be very
large on systems with many cores, so it needs to be part
of the ets table's memory utilization. We use that memory
to calculate how many tables can be created when testing.

@garazdawi garazdawi added team:VM Assigned to OTP team VM bug Issue is reported as a bug labels Dec 7, 2021
@garazdawi garazdawi self-assigned this Dec 7, 2021
@garazdawi garazdawi added the testing currently being tested, tag is used by OTP internal CI label Dec 7, 2021
Comment on lines +3082 to +3084
%% The memory of ordered_set with write concurrency is
%% smaller than without write concurrency on systems with
%% few schedulers.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The non-ca implementation pre-allocates memory to use as the traversal stack, so that uses a bit of extra memory for non-ca. As the number of schedulers grow, the base node rw lock in the ca implementation starts using more and more memory, and at 6 schedulers that memory is the same as the size of the pre-allocated traversal stack.

erts/emulator/beam/erl_db.c Outdated Show resolved Hide resolved
The amount of memory used for reader groups can be very
large on systems with many cores, so it needs to be part
of the ets table's memory utilization. We use that memory
to calculate how many tables can be created when testing.
@garazdawi garazdawi force-pushed the lukas/erts/fix-ets-read_concurrency-memory branch from 6780d18 to a67c456 Compare December 22, 2021 09:57
@garazdawi garazdawi merged commit d2e67fa into erlang:master Dec 22, 2021
@garazdawi garazdawi deleted the lukas/erts/fix-ets-read_concurrency-memory branch December 22, 2021 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is reported as a bug 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.

None yet

2 participants