/Teaching/System Level Programming/Assignments/A3

Task: Memory Layout and Demand Paging


In this assignment, we want to analyze the memory layout and behaviour of 64bit programs.
All experiments should be run on a recent, default-configured 64-bit Ubuntu Linux machine with gcc/g++ >= 8.

We will examine differences in the behaviour of the following groups of variables:

  1. Global variables (variables allocated in global scope)
  2. Local variables (variables allocated in different threads)
  3. Static variables (variables allocated with the static keyword)
  4. “Malloc variables” (variables allocated with malloc)
  5. “Shared (memory) variables” (variables allocated in shared memory – everything allocated with mmap)
  6. “Extern variables” (variables declared with the extern keyword)

To get points on this assignment, you must answer questions and participate in one of the discussion sessions.
Attention: The questionnaire will close at the actual deadline without the grace period.

Your tasks:

  • Log in to the SLP Test System and go to the Questionnaire Page
  • Write short programs to answer the questions.
    • Add these programs/notes/bash commands to your repo in folder A3.
    • We will not check these programs/notes/bash commands; if they are not there, we do not care. However, in the exercise interview, you will have to demonstrate how to run one of the experiments. In the worst case, you must live-implement it within the short exercise interview. Also, if we suspect plagiarism, these files can be your defence.
    • The questions are unrestricted multiple choice. Any number of options from zero to all can be correct.
    • Make sure only to submit answers you can explain.
    • Answer the questions and tag your submission A3 before the deadline (no late submissions!).
  • Register and participate in one of the discussion sessions
    • The discussions will take place in person in small groups (if the situation permits)
    • We will discuss the questions and solutions from the questionnaire
    • Everyone has to give valuable contributions to the discussion to get points on the questionnaire
    • Insufficient or no contributions at all will lead to point deductions on your final A3 points
  • Final Points: Points earned in the questionnaire +/- points from the discussion session

Discussion sessions

Please prepare three sheets of paper with your name and matriculation number for the discussion session. The first sheet will be used to track attendance and will be collected at the start of the discussion round. Additionally, one sheet will be collected for each valuable contribution you make. You will unlock 1/3 of your points per sheet you lose. For example, if you have 15 points based on your answers to the questions, your final points will be:
– 0 if you do not attend the discussion round.
– 5 if you lose one sheet of paper (i.e. you only attend the discussion round).
– 10 if you lose two sheets of paper (i.e. you contribute only once).
– 15 if you lose all sheets of paper (i.e. you contribute at least twice).

Assignment Tutor

If you have questions regarding this assignment, attend the question hours and try Discord and slp@iaik.tugraz.at as a final resort. If you have a more direct question regarding your specific solution, you can also ask the tutors who organize this assignment:

Stefan Radic, stefan.radic@student.tugraz.at
Thomas Knoll, thomas.knoll@student.tugraz.at