ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

What's different between stack memory and heap memory?

user-image
تم إضافة السؤال من قبل George Yaney , Document Controller , national steel fabrication (nsf)
تاريخ النشر: 2013/11/22
Aya Taleb
من قبل Aya Taleb , Senior Web Developer / Team Leader , Bayt.com / Talentera

Hi George,

Here are the main differences:

 

Stack memory:

  • Is a data structure to storing data using the LIFO algo (last in first out).
  • Will be removed once the program go out - end running - the scope of its declaration OR all items were poped out.

Heap memory:

  • Is a data structure to storing and retrieving data using the pointers and addresses in memory ( the items locations are not ordered sequentially).
  • Will not be removed untill you remove it manually using the garbage collection.

 

Regards,

المزيد من الأسئلة المماثلة