diff options
author | Sverker Eriksson <[email protected]> | 2017-12-21 13:26:49 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2017-12-21 13:26:49 +0100 |
commit | fb60cf1408edc6ee03c7e391419367d047721809 (patch) | |
tree | ca55518da06cca15003d3415aa3f32f1e152619a /lib/kernel | |
parent | ef4f493c4ccc23d8d43f97f99f35f1bb987b6c44 (diff) | |
parent | f0cf0f34e72db49c9b6011a3379b300fe66035fd (diff) | |
download | otp-fb60cf1408edc6ee03c7e391419367d047721809.tar.gz otp-fb60cf1408edc6ee03c7e391419367d047721809.tar.bz2 otp-fb60cf1408edc6ee03c7e391419367d047721809.zip |
Merge branch 'sverker/cuddle-valgrind' into maint
Diffstat (limited to 'lib/kernel')
-rw-r--r-- | lib/kernel/test/prim_file_SUITE.erl | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/kernel/test/prim_file_SUITE.erl b/lib/kernel/test/prim_file_SUITE.erl index 2f4330c217..e88d42788f 100644 --- a/lib/kernel/test/prim_file_SUITE.erl +++ b/lib/kernel/test/prim_file_SUITE.erl @@ -2108,12 +2108,25 @@ free_memory() -> {value, {buffered_memory, Buffed}} -> Buffed; false -> 0 end), - TotFree div (1024*1024) + usable_mem(TotFree) div (1024*1024) catch error : undef -> ct:fail({"os_mon not built"}) end. +usable_mem(Memory) -> + case test_server:is_valgrind() of + true -> + %% Valgrind uses extra memory for the V- and A-bits. + %% http://valgrind.org/docs/manual/mc-manual.html#mc-manual.value + %% Docs says it uses "compression to represent the V bits compactly" + %% but let's be conservative and cut usable memory in half. + Memory div 2; + false -> + Memory + end. + + %%%----------------------------------------------------------------- %%% Utilities rm_rf(Mod,Dir) -> |