Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

GDB Details

Total Marks 5
Starting Date Friday, August 13, 2021
Closing Date Monday, August 16, 2021
Status Open
Question Title Memory Allocation Techniques
Question Description

GDB Statement

Suppose you are working as a software engineer for automobile industry. Automobile industry is about to build some new automated machines for its assembly line. These machines will be using an OS without any file system. These machines will be doing fixed number of movements in loop at assembly line and there will be no other use of these machines. Execution of every move should be as fast as hardware limitation allows.

Considering the requirements given in above scenario, which memory allocation approach will you choose? Static memory allocation or dynamic memory allocation? Justify your answer with the proper reasoning.

GDB Instructions

1. You need to provide precise and to the point answer, avoid irrelevant details.

2. Material that is copied from the internet or another student will get zero marks.

3. You cannot participate in the discussion after the due date via email.

4. The GDB will open and close on specified date and time. Please note that NO grace day or extra time will be given for posting comments on GDB.

Views: 217

Replies to This Discussion

Answer

I will choose Static memory allocation

Static memory allocation: In static memory allocation memory is allocated at compile time, and memory can not be extended, i.e., cannot be changed later. In this memory allocation scheme, execution is faster than dynamic memory allocation.

For example two int arrays are declared, one initialized, one not.

int a[10];    
int b[5] {8, 20, 25, 9, 14};


The   "a"   array has 10 elements with subscripts numbered from 0 to 9, filled with garbage.

The   "b"   array has 5 elements with subscripts numbered from 0 to 4, filled with the five given values. They accessed in the usual way, e.g., a[5] or b[2].

The memory is allocated at compile time. A memory picture of these arrays show 10 int garbage values and 5 valid int values:




RSS

Looking For Something? Search Below

Latest Activity

waseem akram left a comment for Huma Ahmad
46 minutes ago
waseem akram left a comment for Huma Ahmad
55 minutes ago
Hania Khalid Shariff is now friends with Mr Siren Head and Huma Ahmad
2 hours ago
saba zulfqar posted blog posts
6 hours ago
+ ¢αяєℓєѕѕ gιяℓ updated their profile
6 hours ago
saba zulfqar and Hania Khalid Shariff are now friends
9 hours ago
Mr Siren Head replied to Hania Khalid Shariff's discussion zero semester
14 hours ago
Profile Iconshahzad Hussain and Umar Farooq joined Virtual University of Pakistan
15 hours ago

VIP Member Badge & Others

How to Get This Badge at Your Profile DP

------------------------------------

Management: Admins ::: Moderators

Other Awards Badges List Moderators Group

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service