[MC] Allocation of the stacks outside of the heap
Inria Forge bug #17143: https://gforge.inria.fr/tracker/index.php?func=detail&aid=17143&group_id=12&atid=165
From: Gabriel Corona
Date: 01/04/2014 16:34
A downside of allocating the stacks on the heap is that when snapshoting the appliaction, the stacks are completely snapshoted (as they contribute to the heap). For this reason, there is a need to optimize the size of the stacks for the application :
-
if the stack is too small, the application will overflow the stack;
-
increasing the size of the stack, increases the memory consumption dramatically (as the stack size if amplified by the number of threads and the number of snapshots).
Allocating the stack outside the heap would solve all this problem. It would not be necessary to use a low stack size as only the size really used would contribute to the memory usage (for the application and for the snapshots).
Expected benefits:
-
no need to tune the stack size fot the application;
-
lower memory consumption.
Downsides:
- increased complexity of address translations between the application and its snapshot (in O(threads)).
From: Gabriel Corona
Date: 04/04/2014 12:24
In fact, address trnaslation would be in O(log(processes)).
From: Gabriel Corona
Date: 11/04/2014 09:04
Un autre avantage est qu'on peut détecter des stacks overflow ce qui n'est pas possible si l'on créé la pile dans le tas.