Question d’entretien chez Valeo

Questions about memory (ram/rom/stack/heap)

Réponse à la question d'entretien

Utilisateur anonyme

26 juin 2016

RAM : volatile memory , is needed after start up and during running operation , writing on it is faster than ROM , several gigabytes , (static ram , dynamic ram) ROM : non-volatile memory , is needed at startup of system , writing on it is slower than ram , several megabytes (PROM(Programmable ROM , Erasable PROM , Electrically-Erasable PROM) ========================================================================Stack: * the stack grows and shrinks as functions push and pop local variables * there is no need to manage the memory yourself, variables are allocated and freed automatically * the stack has size limits * stack variables only exist while the function that created them, is running Heap: * variables can be accessed globally * no limit on memory size * (relatively) slower access * no guaranteed efficient use of space, memory may become fragmented over time as blocks of memory are allocated, then freed you must manage memory (you're in charge of allocating and freeing variables) * variables can be resized using realloc() Heap:

1