-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreadme
246 lines (193 loc) · 10.3 KB
/
readme
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
Assignment 6 readme File
------------------------------------------------------------------------
Student 1: What is your name?
Nate Wilson
------------------------------------------------------------------------
Student 2: What is your name?
Narek Galstyan
------------------------------------------------------------------------
Student 1: What authorized sources of information did you use to
complete the assignment? COPY THE LIST of authorized sources of
information given in the "Policies" web page to this section of the
readme file, and edit it as appropriate.
The course's lectures.
Used.
The course's precepts.
Absolutely essential.
The course's website.
I used this helpful resource
Documents that are referenced directly by the course's website.
Such documents include the course's lecture slides and precept handouts.
Essential and used.
The course's textbooks.(for extra challenge)
The man pages on the CourseLab cluster.
Not really used.
The course's current staff members outside of class time through office hours.
Office hours with Dr Dondero and Dr Gupta were essential.
The course's current staff members outside of class time through meetings.
Not used.
The course's current staff members outside of class time through Piazza.
Piazza was helpful.
The course's current staff members outside of class time through e-mail.
Not used.
Current lab teaching assistants through visits to the course labs.
Not used.
------------------------------------------------------------------------
Student 2: What authorized sources of information did you use to
complete the assignment? COPY THE LIST of authorized sources of
information given in the "Policies" web page to this section of the
readme file, and edit it as appropriate.
The course's lectures.
The course's precepts.
The course's website.
Documents that are referenced directly by the course's website.
Such documents include the course's lecture slides and precept handouts.
The course's textbooks.(for extra challenge)
The man pages on the CourseLab cluster.
The course's current staff members outside of class time through
office hours.
Office hours with Dr Dondero and Dr Gupta were essential.
The course's current staff members outside of class time through Piazza.
------------------------------------------------------------------------
Student 1: What unauthorized sources of information did you use to
complete the assignment? List any unauthorized sources of information
that you used to complete the assignment, and describe how you used
them. The course "Policies" web page defines unauthorized sources of
information, and any source that you have used but not listed in the
authorized sources should be included here. Please note that using an
unauthorized source may trigger a course penalty, and depending on the
nature of the interaction, may additionally require the interaction
being reported to the Committee on Discipline. Write "None" if you used
no unauthorized sources of information.
None.
------------------------------------------------------------------------
Student 2: What unauthorized sources of information did you use to
complete the assignment? List any unauthorized sources of information
that you used to complete the assignment, and describe how you used
them. The course "Policies" web page defines unauthorized sources of
information, and any source that you have used but not listed in the
authorized sources should be included here. Please note that using an
unauthorized source may trigger a course penalty, and depending on the
nature of the interaction, may additionally require the interaction
being reported to the Committee on Discipline. Write "None" if you used
no unauthorized sources of information.
None.
------------------------------------------------------------------------
Student 1: What is your assessment of the assignment? Was it helpful?
Was it fun?
I found this assignment quite engaging!
------------------------------------------------------------------------
Student 2: What is your assessment of the assignment? Was it helpful?
Was it fun?
Well, the assembly is still the highlight but this was very useful
I think I will end up using this code whenever I use C with dynamic
memory for debugging
------------------------------------------------------------------------
(optional) What information can you provide about your submission that
will help your grader to grade it in the most favorable light? In
particular, what bugs are in your submission?
------------------------------------------------------------------------
What warnings does splint generate on
testheapmgr1.c/heapmgr1.c/checker1.c/chunk.c, and what are your
disagreements with them? Copy the splint warnings here, and express your
disagreement after each warning. If there are no warnings, then write
"None."
None.
------------------------------------------------------------------------
What warnings does critTer generate on checker1.c, and what are your
disagreements with them? Copy the critTer warnings here, and express
your disagreement after each warning. If there are no warnings, then
write "None."
checker1.c: line 16: low priority:
A function should consist of fewer than 140 lines;
this function consists of 255 lines; consider refactoring
- This makes sense because although checker is one function,
it actually does several discrete jobs.
------------------------------------------------------------------------
What warnings does critTer generate on heapmgr1.c, and what are your
disagreements with them? Copy the critTer warnings here, and express
your disagreement after each warning. If there are no warnings, then
write "None."
None
------------------------------------------------------------------------
What warnings does splint generate on
testheapmgr.c/heapmgr2.c/checker2.c/chunk.c, and what are your
disagreements with them? Copy the splint warnings here, and express your
disagreement after each warning. If there are no warnings, then write
"None."
None.
------------------------------------------------------------------------
What warnings does critTer generate on checker2.c, and what are your
disagreements with them? Copy the critTer warnings here, and express
your disagreement after each warning. If there are no warnings, then
write "None."
checker2.c: line 85: low priority:
A loop should consist of fewer than 35 lines;
this loop consists of 168 lines; consider refactoring
checker2.c: line 16: low priority:
A function should consist of fewer than 140 lines;
this function consists of 283 lines; consider refactoring
checker2.c: line 121: low priority:
This area is deeply nested at level 4, consider refactoring
checker2.c: line 177: low priority:
This area is deeply nested at level 4, consider refactoring
checker2.c: line 273: low priority:
This area is deeply nested at level 4, consider refactoring
checker2.c: line 293: low priority:
This area is deeply nested at level 4, consider refactoring
-All of these low priority warnings are due to the unusual nature
of the checker function. Although it is one function, it actually
does many discrete jobs.
------------------------------------------------------------------------
What warnings does critTer generate on heapmgr2.c, and what are your
disagreements with them? Copy the critTer warnings here, and express
your disagreement after each warning. If there are no warnings, then
write "None."
None.
------------------------------------------------------------------------
What are the CPU times and heap memory consumed by testheapmgr using
heapmgrgnu.c, heapmgrbase.c, heapmgr1.c, and heapmgr2.c, with tests
RandomRandom and Worst, with call count 100000, and with maximum chunk
sizes 2000 and 20000? COPY THE OUTPUT OF THE testheap SCRIPT HERE.
Executable Test Count Size Time Mem
===============================================================
./testgnu RandomRandom 100000 2000 0.05 135168
./testgnu Worst 100000 2000 0.03 52445184
---------------------------------------------------------------
./testgnu RandomRandom 100000 20000 0.08 135168
./testgnu Worst 100000 20000 0.09 502513664
===============================================================
./test2 RandomRandom 100000 2000 0.03 17825792
./test2 Worst 100000 2000 0.06 54419456
---------------------------------------------------------------
./test2 RandomRandom 100000 20000 0.10 180754144
./test2 Worst 100000 20000 1.31 504410368
===============================================================
./test1 RandomRandom 100000 2000 0.19 22487040
./test1 Worst 100000 2000 15.96 54419456
---------------------------------------------------------------
./test1 RandomRandom 100000 20000 1.33 218522528
./test1 Worst 100000 20000 30.42 504410368
===============================================================
./testbase RandomRandom 100000 2000 6.73 18882560
./testbase Worst 100000 2000 11.10 55803904
---------------------------------------------------------------
./testbase RandomRandom 100000 20000 15.49 183345504
./testbase Worst 100000 20000 61.64 525465344
------------------------------------------------------------------------
How can the heapmgrgnu.c implementation consume so little heap
memory?
There are seval ways malloc could be optimized. one of them is using
the Buddy Systems which is similar to heapmgr2 implementation but
uses only powers of two as bucket sizes which makes it easier
to do pointer arithmetic with addresses. Although it introduces more
fragmentation, it is faster because of faster arithmetic
For small mallocs, it seems that gnu version of malloc just allocates
space in data section thereby decreasing the heap usage. Additionally,
building with -o option sometimes eliminates some variables all together
On the other hand, for particularly big mallocs, gnu malloc calls
mmap instead of brk
mmap maps additional physical memory out of the memory space of the
program (out of heap). of course then the free() will need to call
munmap to free it.
------------------------------------------------------------------------