aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_gc.c
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2015-11-16 11:21:49 +0100
committerRickard Green <[email protected]>2015-12-08 14:47:41 +0100
commitac529b0326496e52f3289464f9410001bc3bde6d (patch)
treeb24f2b6ae7b3ad368b70975e60c98a7a0e561981 /erts/emulator/beam/erl_gc.c
parente8f6435d3c932a03101c12a1263d355112e399bf (diff)
downloadotp-ac529b0326496e52f3289464f9410001bc3bde6d.tar.gz
otp-ac529b0326496e52f3289464f9410001bc3bde6d.tar.bz2
otp-ac529b0326496e52f3289464f9410001bc3bde6d.zip
Fix memory leaks
Diffstat (limited to 'erts/emulator/beam/erl_gc.c')
-rw-r--r--erts/emulator/beam/erl_gc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_gc.c b/erts/emulator/beam/erl_gc.c
index 6cb37752bc..3bb1f601aa 100644
--- a/erts/emulator/beam/erl_gc.c
+++ b/erts/emulator/beam/erl_gc.c
@@ -734,6 +734,12 @@ erts_garbage_collect_hibernate(Process* p)
p->arg_reg,
p->arity);
+ ERTS_HEAP_FREE(ERTS_ALC_T_HEAP,
+ (p->abandoned_heap
+ ? p->abandoned_heap
+ : p->heap),
+ p->heap_sz * sizeof(Eterm));
+
p->heap = heap;
p->high_water = htop;
p->htop = htop;
@@ -1435,7 +1441,7 @@ major_collection(Process* p, ErlHeapFragment *live_hf_end,
(p->abandoned_heap
? p->abandoned_heap
: HEAP_START(p)),
- (HEAP_END(p) - HEAP_START(p)) * sizeof(Eterm));
+ p->heap_sz * sizeof(Eterm));
p->abandoned_heap = NULL;
p->flags &= ~F_ABANDONED_HEAP_USE;
HEAP_START(p) = n_heap;