Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Explain why memory preallocation can help improve runtime performance. (ii) You

ID: 3856219 • Letter: E

Question

Explain why memory preallocation can help improve runtime performance. (ii) You are asked to develop code using Matlab functions to determine the equivalent thermal resistance of an aircraft. You can approximate shape as a long cylinder as shown below. The first function reads in the overall fuselage (cylinder) measurements (length, diameter) as well as average air density at cruising speed. It calculates total surface area A_total, and volume V. It then determines mass of air M (density x volume) and returns M and A_total the base workspace. Use input validation for all inputted values. Formulae for Area and Volume are as follows: Area A_total = 2 pi r l + 2 pi r^2, where r = radius and I = length Volume V = pi r^2 I The second function is passed the total area A_total. It reads in number of windows (presumed circular and identical) and radius of windows. Use input validation for all values. It then determines total window area A_window, and fuselage body area A_ and returns both values to base workspace. The third function uses the 2 area values to determine the overall thermal resistance. It asks the user for U-values. one for the fuselage body and other for the airplane windows, and returns Requiv to base workspace. Use input validation as above.

Explanation / Answer

1. Memory Pre allocation helps in improving the runtime performance: - Memory Pre allocation refers to allocating the memory to a variable or an object before processing or executing the variable.

Runtime environment refers to the environment after the program has compiled and is being executed.

So, if the memory is allocated before the execution of the program, the variable has to use the Ram and hard disk to allocate a default value or fetch its value from the Hard Disk after the execution of the program, and the CPU Burst time (execution time of CPU), is very precious, so if the memory/values to the variables are already allocated before the execution of the program, then this will save the CPU time as well as use less Ram.

So, this is the reason pre allocation of Memory helps in improving Runtime Performance.

This is all for the question.

We are allowed to answer only one question at a time, so to get answer to your 2nd question, please repost it separately.

Thank You for using Chegg...!!!

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote