Check your grade and remarks here.
Check the Grading Scheme here.
Check the sample solution here.
Process.cpp, ProcessNode.cpp, ProcessQueue.cpp, and ProcessScheduler.cpp files to compile and run these two programs.grader with the following command line options:
-o results.txt to write the output into the specified textfile.-s to also output successful cases."Process""ProcessQueue enqueue() and dequeue()""ProcessQueue is_empty()""AddProcess1""AddProcess2""RemoveProcess""Quantum""Aging1""Aging2""Randomized Stress Test"memory_leak_grader with Dr. Memory or Valgrind to get the memory leak report.grader and memory_leak_grader are not consistent with your given grade.
Attach your grader and/or memory_leak_grader output as textfile(s) in your email.
If the grader or memory_leak_grader program crashes or enters an infinite loop for any of the test cases,
and the cause is only due to a minor bug (e.g. forgetting to check for nullptr),
you may fix the bug and send an email to Bing Yen with your updated .cpp file(s), as well as a description of the fix.
We will regrade your assignment only for the "Process", "ProcessQueue", and "ProcessScheduler" portions,
but we will not regrade the "Randomized Stress Test" and "Memory Leak" portions.
However, we will not regrade if the bugfix is not obvious and straightforward.
You can use Dr. Memory
or Valgrind to check memory
leak. After your program finishes, these tools will generate a
report containing all the memory related issues.
Run the following in command line:
X:\path\to\drmemory\bin64\drmemory.exe X:\path\to\your\executable.exe
You will get following message:
Error #1: LEAK 16 direct bytes 0x0000000002fd0dc0-0x0000000002fd0dd0 + 0 indirect bytes
# 0 replace_operator_new [d:\drmemory_package\common\alloc_replace.c:2900]
# 1 ProcessScheduler::add_process [C:\memory_leak_tester\../ProcessScheduler.cpp:74]
# 2 main [C:\memory_leak_tester\../memory_leak_grader.cpp:18]
FINAL SUMMARY:
ERRORS FOUND:
1 unique, 1023 total, 16368 byte(s) of leak(s)
Note:Process, ProcessNode, ProcessQueue, or ProcessScheduler.
Run the following in command line:
$ valgrind --tool=memcheck --leak-check=full path/to/your/executable
You will get the following message:
==10425== HEAP SUMMARY: ==10425== in use at exit: 16,368 bytes in 1023 blocks ==10425== total heap usage: 1023 allocs, 0 frees, 16,368 bytes allocated ==10425== ==10425== 16,368 bytes in 1023 blocks are definitely lost in loss record 1 of 1 ==10425== at 0x4838DEF: operator new(unsigned long) (vg_replace_malloc.c:334) ==10425== by 0x109146: ProcessScheduler::add_process() (in /some/dir/test) ==10425== by 0x109152: main (in /some/dir/test)Note: Valgrind doesn't support Windows.