Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What's different between stack memory and heap memory?

user-image
Question added by George Yaney , Document Controller , national steel fabrication (nsf)
Date Posted: 2013/11/22
Aya Taleb
by 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,

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.