This is an old revision of the document!


01. [10p] Memory usage

Open ex01.py and take a look at the code. What is the difference between the methods do_append() and do_allocate()?

Use vmstat to monitor the memory usage while performing the following experiments. In the main method, call:

  • The do_append method on it's own (see Experiment 1).
  • The do_allocate method on it's own (see Experiment 2).
  • Both methods as shown in the Experiment 3 area in the code.
  • Both methods as shown in the Experiment 4 area in the code.

Offer an interpretation for the obtained results and try to change the behavior so that the memory usage will be the same when performing any of the experiments (without changing the code). HINT: Python GC

Explain in a paragraph how Generational Garbage Collection works.
In a python shell, get the generational thresholds and the current number of live references in each generation.
Copy+paste the code and the resulting values or add a screenshot.

ep/labs/02/contents/tasks/ex1.1633973142.txt.gz ยท Last modified: 2021/10/11 20:25 by gheorghe.petre2608
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0