Skip to content

Commit

Permalink
Merge pull request #8928 from bjorng/bjorn/lower-memory-requirements-…
Browse files Browse the repository at this point in the history
…for-tests

tests: Limit the number of parallel processes on 32-bit systems
  • Loading branch information
bjorng authored Oct 22, 2024
2 parents 299e3b8 + 6581757 commit bcafd64
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
10 changes: 6 additions & 4 deletions lib/asn1/test/asn1_test_lib.erl
Original file line number Diff line number Diff line change
Expand Up @@ -307,16 +307,18 @@ ber_get_len(<<1:1,Octets:7,T0/binary>>) ->

p_run(Test, List) ->
%% Limit the number of parallel processes to avoid running out of
%% memory.
%% virtual address space or memory. This is especially important
%% on 32-bit Windows, where only 2 GB of virtual address space is
%% available.
S = case {erlang:system_info(schedulers),erlang:system_info(wordsize)} of
{S0,4} ->
min(S0, 2);
{_,4} ->
1;
{S0,_} ->
min(S0, 8)
end,
N = case test_server:is_cover() of
false ->
S + 1;
S;
true ->
%% Cover is running. Using too many processes
%% could slow us down.
Expand Down
15 changes: 8 additions & 7 deletions lib/compiler/test/test_lib.erl
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,15 @@ highest_opcode(Beam) ->

p_run(Test, List) ->
%% Limit the number of parallel processes to avoid running out of
%% memory.
S = case {erlang:system_info(schedulers),erlang:system_info(wordsize)} of
{S0,4} ->
min(S0, 2);
{S0,8} ->
min(S0, 8)
%% virtual address space or memory. This is especially important
%% on 32-bit Windows, where only 2 GB of virtual address space is
%% available.
N = case {erlang:system_info(schedulers),erlang:system_info(wordsize)} of
{_,4} ->
1;
{N0,8} ->
min(N0, 8)
end,
N = S + 1,
p_run(Test, List, N).

p_run(Test, List, N) ->
Expand Down

0 comments on commit bcafd64

Please sign in to comment.