aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2017-12-21 13:27:35 +0100
committerSverker Eriksson <[email protected]>2017-12-21 13:27:35 +0100
commitbe5141bd723f7e7a39cd3015b39a4308781a8d1b (patch)
treeeb21fac7abfff9fad5c1de6dd2d975768daf75c4 /lib/kernel
parent324265a52cf196d984af65563b1a0662f0164a30 (diff)
parentfb60cf1408edc6ee03c7e391419367d047721809 (diff)
downloadotp-be5141bd723f7e7a39cd3015b39a4308781a8d1b.tar.gz
otp-be5141bd723f7e7a39cd3015b39a4308781a8d1b.tar.bz2
otp-be5141bd723f7e7a39cd3015b39a4308781a8d1b.zip
Merge branch 'maint'
Diffstat (limited to 'lib/kernel')
-rw-r--r--lib/kernel/test/prim_file_SUITE.erl15
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 db753679ea..ab62f4dc34 100644
--- a/lib/kernel/test/prim_file_SUITE.erl
+++ b/lib/kernel/test/prim_file_SUITE.erl
@@ -1787,12 +1787,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) ->