This is an old revision of the document!


03. [10p] Monitor the system performance

High risk of freezing your computer. Show the assistant your progress before starting this exercise!

[5p] Generating a script

  • Create a 1GB file of random generated integers ranging from 1 to 10 million.
  • Write a script/C program to sort the numbers in this file in ascending order.

[5p] Monitoring the performance

  • Monitor the system performance using the tools presented in this tutorial.

Good to know:

  • Split the file into smaller chunks that would fit in memory (e.g. 200MB).
  • Use a classical sort algorithm for sorting these chunks.
  • Merge the sorted chunks two by two. Read in memory only two numbers at a time (one from each chunk) starting from the beginning, compare the numbers, write the smallest in the merged file, and read the next number from the chunk that had its number written in the merged file.
  • Repeat the last step until you obtain the original file sorted.
ep/labs/03/contents/tasks/ex4.1570980067.txt.gz ยท Last modified: 2019/10/13 18:21 by emilian.radoi
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