1 | \chapter{Performance} |
---|
2 | \label{c:Performance} |
---|
3 | |
---|
4 | This chapter uses the micro-benchmarks from \VRef[Chapter]{s:Benchmarks} to test a number of current memory allocators, including llheap. |
---|
5 | The goal is to see if llheap is competitive with the current best memory allocators. |
---|
6 | |
---|
7 | |
---|
8 | \section{Machine Specification} |
---|
9 | |
---|
10 | The performance experiments were run on two different multi-core architectures (x86 and ARM) to determine if there is consistency across platforms: |
---|
11 | \begin{itemize} |
---|
12 | \item |
---|
13 | \textbf{Nasus} AMD EPYC 7662, 64-core socket $\times$ 2, 2.0 GHz, GCC version 9.3.0 |
---|
14 | \item |
---|
15 | \textbf{Algol} Huawei ARM TaiShan 2280 V2 Kunpeng 920, 24-core socket $\times$ 4, 2.6 GHz, GCC version 9.4.0 |
---|
16 | \end{itemize} |
---|
17 | |
---|
18 | |
---|
19 | \section{Existing Memory Allocators} |
---|
20 | \label{sec:curAllocatorSec} |
---|
21 | |
---|
22 | With dynamic allocation being an important feature of C, there are many stand-alone memory allocators that have been designed for different purposes. |
---|
23 | For this thesis, 7 of the most popular and widely used memory allocators were selected for comparison. |
---|
24 | |
---|
25 | \subsection{glibc} |
---|
26 | glibc~\cite{glibc} is the default gcc thread-safe allocator. |
---|
27 | \\ |
---|
28 | \textbf{Version:} Ubuntu GLIBC 2.31-0ubuntu9.7 2.31\\ |
---|
29 | \textbf{Configuration:} Compiled by Ubuntu 20.04.\\ |
---|
30 | \textbf{Compilation command:} N/A |
---|
31 | |
---|
32 | \subsection{dlmalloc} |
---|
33 | dlmalloc~\cite{dlmalloc} is a thread-safe allocator that is single threaded and single heap. |
---|
34 | It maintains free-lists of different sizes to store freed dynamic memory. |
---|
35 | \\ |
---|
36 | \textbf{Version:} 2.8.6\\ |
---|
37 | \textbf{Configuration:} Compiled with preprocessor @USE_LOCKS@.\\ |
---|
38 | \textbf{Compilation command:} @gcc -g3 -O3 -Wall -Wextra -fno-builtin-malloc -fno-builtin-calloc@ @-fno-builtin-realloc -fno-builtin-free -fPIC -shared -DUSE_LOCKS -o libdlmalloc.so malloc-2.8.6.c@ |
---|
39 | |
---|
40 | \subsection{hoard} |
---|
41 | Hoard~\cite{hoard} is a thread-safe allocator that is multi-threaded and using a heap layer framework. It has per-thread heaps that have thread-local free-lists, and a global shared heap. |
---|
42 | \\ |
---|
43 | \textbf{Version:} 3.13\\ |
---|
44 | \textbf{Configuration:} Compiled with hoard's default configurations and @Makefile@.\\ |
---|
45 | \textbf{Compilation command:} @make all@ |
---|
46 | |
---|
47 | \subsection{jemalloc} |
---|
48 | jemalloc~\cite{jemalloc} is a thread-safe allocator that uses multiple arenas. Each thread is assigned an arena. Each arena has chunks that contain contagious memory regions of same size. An arena has multiple chunks that contain regions of multiple sizes. |
---|
49 | \\ |
---|
50 | \textbf{Version:} 5.2.1\\ |
---|
51 | \textbf{Configuration:} Compiled with jemalloc's default configurations and @Makefile@.\\ |
---|
52 | \textbf{Compilation command:} @autogen.sh; configure; make; make install@ |
---|
53 | |
---|
54 | \subsection{pt3malloc} |
---|
55 | pt3malloc~\cite{pt3malloc} is a modification of dlmalloc. |
---|
56 | It is a thread-safe multi-threaded memory allocator that uses multiple heaps. pt3malloc heap has similar design to dlmalloc's heap. |
---|
57 | \\ |
---|
58 | \textbf{Version:} 1.8\\ |
---|
59 | \textbf{Configuration:} Compiled with pt3malloc's @Makefile@ using option ``linux-shared''.\\ |
---|
60 | \textbf{Compilation command:} @make linux-shared@ |
---|
61 | |
---|
62 | \subsection{rpmalloc} |
---|
63 | rpmalloc~\cite{rpmalloc} is a thread-safe allocator that is multi-threaded and uses per-thread heap. Each heap has multiple size-classes and each size-class contains memory regions of the relevant size. |
---|
64 | \\ |
---|
65 | \textbf{Version:} 1.4.1\\ |
---|
66 | \textbf{Configuration:} Compiled with rpmalloc's default configurations and ninja build system.\\ |
---|
67 | \textbf{Compilation command:} @python3 configure.py; ninja@ |
---|
68 | |
---|
69 | \subsection{tbb malloc} |
---|
70 | tbb malloc~\cite{tbbmallocmail |
---|
71 | } is a thread-safe allocator that is multi-threaded and uses private heap for each thread. Each private-heap has multiple bins of different sizes. Each bin contains free regions of the same size. |
---|
72 | \\ |
---|
73 | \textbf{Version:} intel tbb 2020 update 2, tbb\_interface\_version == 11102\\ |
---|
74 | \textbf{Configuration:} Compiled with tbbmalloc's default configurations and @Makefile@.\\ |
---|
75 | \textbf{Compilation command:} @make@ |
---|
76 | |
---|
77 | % \section{Experiment Environment} |
---|
78 | % We used our micro benchmark suite (FIX ME: cite mbench) to evaluate these memory allocators \ref{sec:curAllocatorSec} and our own memory allocator uHeap \ref{sec:allocatorSec}. |
---|
79 | |
---|
80 | \section{Experiments} |
---|
81 | % FIX ME: add experiment, knobs, graphs, description+analysis |
---|
82 | |
---|
83 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
84 | %% CHURN |
---|
85 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
86 | |
---|
87 | \subsection{Churn Micro-Benchmark} |
---|
88 | |
---|
89 | Churn tests allocators for speed under intensive dynamic memory usage (see \VRef{s:ChurnBenchmark}). |
---|
90 | This experiment was run with following configurations: |
---|
91 | \begin{description}[itemsep=0pt,parsep=0pt] |
---|
92 | \item[thread:] |
---|
93 | 1, 2, 4, 8, 16 |
---|
94 | \item[spots:] |
---|
95 | 16 |
---|
96 | \item[obj:] |
---|
97 | 100,000 |
---|
98 | \item[max:] |
---|
99 | 500 |
---|
100 | \item[min:] |
---|
101 | 50 |
---|
102 | \item[step:] |
---|
103 | 50 |
---|
104 | \item[distro:] |
---|
105 | fisher |
---|
106 | \end{description} |
---|
107 | |
---|
108 | % -maxS : 500 |
---|
109 | % -minS : 50 |
---|
110 | % -stepS : 50 |
---|
111 | % -distroS : fisher |
---|
112 | % -objN : 100000 |
---|
113 | % -cSpots : 16 |
---|
114 | % -threadN : 1, 2, 4, 8, 16 |
---|
115 | |
---|
116 | \VRef[Figure]{fig:churn} shows the results for algol and nasus. |
---|
117 | The X-axis shows the number of threads. |
---|
118 | Each allocator's performance for each thread is shown in different colors. |
---|
119 | The Y-axis shows the total experiment time. |
---|
120 | |
---|
121 | \begin{figure} |
---|
122 | \centering |
---|
123 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/churn} } |
---|
124 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/churn} } |
---|
125 | \caption{Churn} |
---|
126 | \label{fig:churn} |
---|
127 | \end{figure} |
---|
128 | |
---|
129 | All allocators did well in this micro-benchmark, except for dmalloc on the ARM, |
---|
130 | |
---|
131 | |
---|
132 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
133 | %% THRASH |
---|
134 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
135 | |
---|
136 | \subsection{Cache Thrash} |
---|
137 | |
---|
138 | Thrash tests memory allocators for active false sharing (see \VRef{sec:benchThrashSec}). |
---|
139 | This experiment was run with following configurations: |
---|
140 | \begin{description}[itemsep=0pt,parsep=0pt] |
---|
141 | \item[thread:] |
---|
142 | 1, 2, 4, 8, 16 |
---|
143 | \item[iterations:] |
---|
144 | 1,000 |
---|
145 | \item[cacheRW:] |
---|
146 | 1,000,000 |
---|
147 | \item[size:] |
---|
148 | 1 |
---|
149 | \end{description} |
---|
150 | |
---|
151 | % * Each allocator was tested for its performance across different number of threads. |
---|
152 | % Experiment was repeated for each allocator for 1, 2, 4, 8, and 16 threads by setting the configuration -threadN. |
---|
153 | |
---|
154 | Results are shown in figure \ref{fig:cacheThrash} for both algol and nasus. |
---|
155 | X-axis shows number of threads. Each allocator's performance for each thread is shown in different colors. |
---|
156 | Y-axis shows the total time experiment took to finish. |
---|
157 | |
---|
158 | \begin{figure} |
---|
159 | \centering |
---|
160 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/cache-time-0-thrash} } |
---|
161 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/cache-time-0-thrash} } |
---|
162 | \caption{Cache Thrash} |
---|
163 | \label{fig:cacheThrash} |
---|
164 | \end{figure} |
---|
165 | |
---|
166 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
167 | %% SCRATCH |
---|
168 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
169 | |
---|
170 | \subsection{Cache Scratch} |
---|
171 | \label{s:CacheScratch} |
---|
172 | |
---|
173 | Scratch tests memory allocators for program-induced allocator-preserved passive false-sharing. |
---|
174 | This experiment was run with following configurations: |
---|
175 | \begin{description}[itemsep=0pt,parsep=0pt] |
---|
176 | \item[threads:] |
---|
177 | 1, 2, 4, 8, 16 |
---|
178 | \item[iterations:] |
---|
179 | 1,000 |
---|
180 | \item[cacheRW:] |
---|
181 | 1,000,000 |
---|
182 | \item[size:] |
---|
183 | 1 |
---|
184 | \end{description} |
---|
185 | |
---|
186 | % * Each allocator was tested for its performance across different number of threads. |
---|
187 | % Experiment was repeated for each allocator for 1, 2, 4, 8, and 16 threads by setting the configuration -threadN. |
---|
188 | |
---|
189 | Results are shown in figure \ref{fig:cacheScratch} for both algol and nasus. |
---|
190 | X-axis shows number of threads. Each allocator's performance for each thread is shown in different colors. |
---|
191 | Y-axis shows the total time experiment took to finish. |
---|
192 | |
---|
193 | \begin{figure} |
---|
194 | \centering |
---|
195 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/cache-time-0-scratch} } |
---|
196 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/cache-time-0-scratch} } |
---|
197 | \caption{Cache Scratch} |
---|
198 | \label{fig:cacheScratch} |
---|
199 | \end{figure} |
---|
200 | |
---|
201 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
202 | %% SPEED |
---|
203 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
204 | |
---|
205 | \subsection{Speed Micro-Benchmark} |
---|
206 | |
---|
207 | Speed testa memory allocators for runtime latency (see \VRef{s:SpeedMicroBenchmark}). |
---|
208 | This experiment was run with following configurations: |
---|
209 | \begin{description}[itemsep=0pt,parsep=0pt] |
---|
210 | \item[max:] |
---|
211 | 500 |
---|
212 | \item[min:] |
---|
213 | 50 |
---|
214 | \item[step:] |
---|
215 | 50 |
---|
216 | \item[distro:] |
---|
217 | fisher |
---|
218 | \item[objects:] |
---|
219 | 1,000,000 |
---|
220 | \item[workers:] |
---|
221 | 1, 2, 4, 8, 16 |
---|
222 | \end{description} |
---|
223 | |
---|
224 | % -maxS : 500 |
---|
225 | % -minS : 50 |
---|
226 | % -stepS : 50 |
---|
227 | % -distroS : fisher |
---|
228 | % -objN : 1000000 |
---|
229 | % -threadN : \{ 1, 2, 4, 8, 16 \} * |
---|
230 | |
---|
231 | %* Each allocator was tested for its performance across different number of threads. |
---|
232 | %Experiment was repeated for each allocator for 1, 2, 4, 8, and 16 threads by setting the configuration -threadN. |
---|
233 | |
---|
234 | Results for speed benchmark are shown in 12 figures, one figure for each chain of speed benchmark. |
---|
235 | X-axis shows number of threads. Each allocator's performance for each thread is shown in different colors. |
---|
236 | Y-axis shows the total time experiment took to finish. Less time an allocator takes to complete allocation, better it is so lower the better. |
---|
237 | |
---|
238 | \begin{itemize} |
---|
239 | \item Fig. \ref{fig:speed-3-malloc} shows results for chain: malloc |
---|
240 | \item Fig. \ref{fig:speed-4-realloc} shows results for chain: realloc |
---|
241 | \item Fig. \ref{fig:speed-5-free} shows results for chain: free |
---|
242 | \item Fig. \ref{fig:speed-6-calloc} shows results for chain: calloc |
---|
243 | \item Fig. \ref{fig:speed-7-malloc-free} shows results for chain: malloc-free |
---|
244 | \item Fig. \ref{fig:speed-8-realloc-free} shows results for chain: realloc-free |
---|
245 | \item Fig. \ref{fig:speed-9-calloc-free} shows results for chain: calloc-free |
---|
246 | \item Fig. \ref{fig:speed-10-malloc-realloc} shows results for chain: malloc-realloc |
---|
247 | \item Fig. \ref{fig:speed-11-calloc-realloc} shows results for chain: calloc-realloc |
---|
248 | \item Fig. \ref{fig:speed-12-malloc-realloc-free} shows results for chain: malloc-realloc-free |
---|
249 | \item Fig. \ref{fig:speed-13-calloc-realloc-free} shows results for chain: calloc-realloc-free |
---|
250 | \item Fig. \ref{fig:speed-14-malloc-calloc-realloc-free} shows results for chain: malloc-realloc-free-calloc |
---|
251 | \end{itemize} |
---|
252 | |
---|
253 | %speed-3-malloc.eps |
---|
254 | \begin{figure} |
---|
255 | \centering |
---|
256 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/speed-3-malloc} } |
---|
257 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/speed-3-malloc} } |
---|
258 | \caption{Speed benchmark chain: malloc} |
---|
259 | \label{fig:speed-3-malloc} |
---|
260 | \end{figure} |
---|
261 | |
---|
262 | %speed-4-realloc.eps |
---|
263 | \begin{figure} |
---|
264 | \centering |
---|
265 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/speed-4-realloc} } |
---|
266 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/speed-4-realloc} } |
---|
267 | \caption{Speed benchmark chain: realloc} |
---|
268 | \label{fig:speed-4-realloc} |
---|
269 | \end{figure} |
---|
270 | |
---|
271 | %speed-5-free.eps |
---|
272 | \begin{figure} |
---|
273 | \centering |
---|
274 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/speed-5-free} } |
---|
275 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/speed-5-free} } |
---|
276 | \caption{Speed benchmark chain: free} |
---|
277 | \label{fig:speed-5-free} |
---|
278 | \end{figure} |
---|
279 | |
---|
280 | %speed-6-calloc.eps |
---|
281 | \begin{figure} |
---|
282 | \centering |
---|
283 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/speed-6-calloc} } |
---|
284 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/speed-6-calloc} } |
---|
285 | \caption{Speed benchmark chain: calloc} |
---|
286 | \label{fig:speed-6-calloc} |
---|
287 | \end{figure} |
---|
288 | |
---|
289 | %speed-7-malloc-free.eps |
---|
290 | \begin{figure} |
---|
291 | \centering |
---|
292 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/speed-7-malloc-free} } |
---|
293 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/speed-7-malloc-free} } |
---|
294 | \caption{Speed benchmark chain: malloc-free} |
---|
295 | \label{fig:speed-7-malloc-free} |
---|
296 | \end{figure} |
---|
297 | |
---|
298 | %speed-8-realloc-free.eps |
---|
299 | \begin{figure} |
---|
300 | \centering |
---|
301 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/speed-8-realloc-free} } |
---|
302 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/speed-8-realloc-free} } |
---|
303 | \caption{Speed benchmark chain: realloc-free} |
---|
304 | \label{fig:speed-8-realloc-free} |
---|
305 | \end{figure} |
---|
306 | |
---|
307 | %speed-9-calloc-free.eps |
---|
308 | \begin{figure} |
---|
309 | \centering |
---|
310 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/speed-9-calloc-free} } |
---|
311 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/speed-9-calloc-free} } |
---|
312 | \caption{Speed benchmark chain: calloc-free} |
---|
313 | \label{fig:speed-9-calloc-free} |
---|
314 | \end{figure} |
---|
315 | |
---|
316 | %speed-10-malloc-realloc.eps |
---|
317 | \begin{figure} |
---|
318 | \centering |
---|
319 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/speed-10-malloc-realloc} } |
---|
320 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/speed-10-malloc-realloc} } |
---|
321 | \caption{Speed benchmark chain: malloc-realloc} |
---|
322 | \label{fig:speed-10-malloc-realloc} |
---|
323 | \end{figure} |
---|
324 | |
---|
325 | %speed-11-calloc-realloc.eps |
---|
326 | \begin{figure} |
---|
327 | \centering |
---|
328 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/speed-11-calloc-realloc} } |
---|
329 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/speed-11-calloc-realloc} } |
---|
330 | \caption{Speed benchmark chain: calloc-realloc} |
---|
331 | \label{fig:speed-11-calloc-realloc} |
---|
332 | \end{figure} |
---|
333 | |
---|
334 | %speed-12-malloc-realloc-free.eps |
---|
335 | \begin{figure} |
---|
336 | \centering |
---|
337 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/speed-12-malloc-realloc-free} } |
---|
338 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/speed-12-malloc-realloc-free} } |
---|
339 | \caption{Speed benchmark chain: malloc-realloc-free} |
---|
340 | \label{fig:speed-12-malloc-realloc-free} |
---|
341 | \end{figure} |
---|
342 | |
---|
343 | %speed-13-calloc-realloc-free.eps |
---|
344 | \begin{figure} |
---|
345 | \centering |
---|
346 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/speed-13-calloc-realloc-free} } |
---|
347 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/speed-13-calloc-realloc-free} } |
---|
348 | \caption{Speed benchmark chain: calloc-realloc-free} |
---|
349 | \label{fig:speed-13-calloc-realloc-free} |
---|
350 | \end{figure} |
---|
351 | |
---|
352 | %speed-14-{m,c,re}alloc-free.eps |
---|
353 | \begin{figure} |
---|
354 | \centering |
---|
355 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/speed-14-m-c-re-alloc-free} } |
---|
356 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/speed-14-m-c-re-alloc-free} } |
---|
357 | \caption{Speed benchmark chain: malloc-calloc-realloc-free} |
---|
358 | \label{fig:speed-14-malloc-calloc-realloc-free} |
---|
359 | \end{figure} |
---|
360 | |
---|
361 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
362 | %% MEMORY |
---|
363 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
364 | |
---|
365 | \subsection{Memory Micro-Benchmark} |
---|
366 | |
---|
367 | This experiment is run with following two configurations for each allocator. |
---|
368 | The difference between the two configurations is the number of producers and consumers. |
---|
369 | Configuration 1 has one producer and one consumer, and configuration 2 has 4 producers where each producer has 4 consumers. |
---|
370 | |
---|
371 | \noindent |
---|
372 | Configuration 1: |
---|
373 | \begin{description}[itemsep=0pt,parsep=0pt] |
---|
374 | \item[producer (K):] |
---|
375 | 1 |
---|
376 | \item[consumer (M):] |
---|
377 | 1 |
---|
378 | \item[round:] |
---|
379 | 100,000 |
---|
380 | \item[max:] |
---|
381 | 500 |
---|
382 | \item[min:] |
---|
383 | 50 |
---|
384 | \item[step:] |
---|
385 | 50 |
---|
386 | \item[distro:] |
---|
387 | fisher |
---|
388 | \item[objects (N):] |
---|
389 | 100,000 |
---|
390 | \end{description} |
---|
391 | |
---|
392 | % -threadA : 1 |
---|
393 | % -threadF : 1 |
---|
394 | % -maxS : 500 |
---|
395 | % -minS : 50 |
---|
396 | % -stepS : 50 |
---|
397 | % -distroS : fisher |
---|
398 | % -objN : 100000 |
---|
399 | % -consumeS: 100000 |
---|
400 | |
---|
401 | \noindent |
---|
402 | Configuration 2: |
---|
403 | \begin{description}[itemsep=0pt,parsep=0pt] |
---|
404 | \item[producer (K):] |
---|
405 | 4 |
---|
406 | \item[consumer (M):] |
---|
407 | 4 |
---|
408 | \item[round:] |
---|
409 | 100,000 |
---|
410 | \item[max:] |
---|
411 | 500 |
---|
412 | \item[min:] |
---|
413 | 50 |
---|
414 | \item[step:] |
---|
415 | 50 |
---|
416 | \item[distro:] |
---|
417 | fisher |
---|
418 | \item[objects (N):] |
---|
419 | 100,000 |
---|
420 | \end{description} |
---|
421 | |
---|
422 | % -threadA : 4 |
---|
423 | % -threadF : 4 |
---|
424 | % -maxS : 500 |
---|
425 | % -minS : 50 |
---|
426 | % -stepS : 50 |
---|
427 | % -distroS : fisher |
---|
428 | % -objN : 100000 |
---|
429 | % -consumeS: 100000 |
---|
430 | |
---|
431 | \begin{table}[b] |
---|
432 | \centering |
---|
433 | \begin{tabular}{ |c|c|c| } |
---|
434 | \hline |
---|
435 | Memory Allocator & Configuration 1 Result & Configuration 2 Result\\ |
---|
436 | \hline |
---|
437 | cfa & Fig. \ref{fig:mem-1-prod-1-cons-100-cfa} & Fig. \ref{fig:mem-4-prod-4-cons-100-cfa}\\ |
---|
438 | \hline |
---|
439 | dl & Fig. \ref{fig:mem-1-prod-1-cons-100-dl} & Fig. \ref{fig:mem-4-prod-4-cons-100-dl}\\ |
---|
440 | \hline |
---|
441 | glibc & Fig. \ref{fig:mem-1-prod-1-cons-100-glc} & Fig. \ref{fig:mem-4-prod-4-cons-100-glc}\\ |
---|
442 | \hline |
---|
443 | hoard & Fig. \ref{fig:mem-1-prod-1-cons-100-hrd} & Fig. \ref{fig:mem-4-prod-4-cons-100-hrd}\\ |
---|
444 | \hline |
---|
445 | je & Fig. \ref{fig:mem-1-prod-1-cons-100-je} & Fig. \ref{fig:mem-4-prod-4-cons-100-je}\\ |
---|
446 | \hline |
---|
447 | pt3 & Fig. \ref{fig:mem-1-prod-1-cons-100-pt3} & Fig. \ref{fig:mem-4-prod-4-cons-100-pt3}\\ |
---|
448 | \hline |
---|
449 | rp & Fig. \ref{fig:mem-1-prod-1-cons-100-rp} & Fig. \ref{fig:mem-4-prod-4-cons-100-rp}\\ |
---|
450 | \hline |
---|
451 | tbb & Fig. \ref{fig:mem-1-prod-1-cons-100-tbb} & Fig. \ref{fig:mem-4-prod-4-cons-100-tbb}\\ |
---|
452 | \hline |
---|
453 | \end{tabular} |
---|
454 | \caption{Memory benchmark results} |
---|
455 | \label{table:mem-benchmark-figs} |
---|
456 | \end{table} |
---|
457 | |
---|
458 | Results for memory benchmark are shown in 16 figures, two figures for each of the 8 allocators, one for each configuration. |
---|
459 | Table \ref{table:mem-benchmark-figs} shows the list of figures that contain memory benchmark results. |
---|
460 | |
---|
461 | Each figure has 2 graphs, one for each experiment environment. |
---|
462 | Each graph has following 5 subgraphs that show program's memory usage and statistics throughout the program lifetime. |
---|
463 | |
---|
464 | \begin{itemize} |
---|
465 | \item \textit{\textbf{current\_req\_mem(B)}} shows the amount of dynamic memory requested and currently in-use of the benchmark. |
---|
466 | \item \textit{\textbf{heap}}* shows the memory requested by the program (allocator) from the system that lies in the heap area. |
---|
467 | \item \textit{\textbf{mmap\_so}}* shows the memory requested by the program (allocator) from the system that lies in the mmap area. |
---|
468 | \item \textit{\textbf{mmap}}* shows the memory requested by the program (allocator or shared libraries) from the system that lies in the mmap area. |
---|
469 | \item \textit{\textbf{total\_dynamic}} shows the total usage of dynamic memory by the benchmark program which is a sum of heap, mmap, and mmap\_so. |
---|
470 | \end{itemize} |
---|
471 | |
---|
472 | * These statistics are gathered by monitoring the \textit{/proc/self/maps} file of the process in linux system. |
---|
473 | |
---|
474 | For each subgraph, x-axis shows the time during the program lifetime at which the data point was generated. |
---|
475 | Y-axis shows the memory usage in bytes. |
---|
476 | |
---|
477 | For the experiment, at a certain time in the program's life, the difference between the memory requested by the benchmark (\textit{current\_req\_mem(B)}) |
---|
478 | and the memory that the process has received from system (\textit{heap}, \textit{mmap}) should be minimum. |
---|
479 | This difference is the memory overhead caused by the allocator and shows the level of fragmentation in the allocator. |
---|
480 | |
---|
481 | %mem-1-prod-1-cons-100-cfa.eps |
---|
482 | \begin{figure} |
---|
483 | \centering |
---|
484 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/mem-1-prod-1-cons-100-cfa} } |
---|
485 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/mem-1-prod-1-cons-100-cfa} } |
---|
486 | \caption{Memory benchmark results with 1 producer for cfa memory allocator} |
---|
487 | \label{fig:mem-1-prod-1-cons-100-cfa} |
---|
488 | \end{figure} |
---|
489 | |
---|
490 | %mem-1-prod-1-cons-100-dl.eps |
---|
491 | \begin{figure} |
---|
492 | \centering |
---|
493 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/mem-1-prod-1-cons-100-dl} } |
---|
494 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/mem-1-prod-1-cons-100-dl} } |
---|
495 | \caption{Memory benchmark results with 1 producer for dl memory allocator} |
---|
496 | \label{fig:mem-1-prod-1-cons-100-dl} |
---|
497 | \end{figure} |
---|
498 | |
---|
499 | %mem-1-prod-1-cons-100-glc.eps |
---|
500 | \begin{figure} |
---|
501 | \centering |
---|
502 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/mem-1-prod-1-cons-100-glc} } |
---|
503 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/mem-1-prod-1-cons-100-glc} } |
---|
504 | \caption{Memory benchmark results with 1 producer for glibc memory allocator} |
---|
505 | \label{fig:mem-1-prod-1-cons-100-glc} |
---|
506 | \end{figure} |
---|
507 | |
---|
508 | %mem-1-prod-1-cons-100-hrd.eps |
---|
509 | \begin{figure} |
---|
510 | \centering |
---|
511 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/mem-1-prod-1-cons-100-hrd} } |
---|
512 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/mem-1-prod-1-cons-100-hrd} } |
---|
513 | \caption{Memory benchmark results with 1 producer for hoard memory allocator} |
---|
514 | \label{fig:mem-1-prod-1-cons-100-hrd} |
---|
515 | \end{figure} |
---|
516 | |
---|
517 | %mem-1-prod-1-cons-100-je.eps |
---|
518 | \begin{figure} |
---|
519 | \centering |
---|
520 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/mem-1-prod-1-cons-100-je} } |
---|
521 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/mem-1-prod-1-cons-100-je} } |
---|
522 | \caption{Memory benchmark results with 1 producer for je memory allocator} |
---|
523 | \label{fig:mem-1-prod-1-cons-100-je} |
---|
524 | \end{figure} |
---|
525 | |
---|
526 | %mem-1-prod-1-cons-100-pt3.eps |
---|
527 | \begin{figure} |
---|
528 | \centering |
---|
529 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/mem-1-prod-1-cons-100-pt3} } |
---|
530 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/mem-1-prod-1-cons-100-pt3} } |
---|
531 | \caption{Memory benchmark results with 1 producer for pt3 memory allocator} |
---|
532 | \label{fig:mem-1-prod-1-cons-100-pt3} |
---|
533 | \end{figure} |
---|
534 | |
---|
535 | %mem-1-prod-1-cons-100-rp.eps |
---|
536 | \begin{figure} |
---|
537 | \centering |
---|
538 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/mem-1-prod-1-cons-100-rp} } |
---|
539 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/mem-1-prod-1-cons-100-rp} } |
---|
540 | \caption{Memory benchmark results with 1 producer for rp memory allocator} |
---|
541 | \label{fig:mem-1-prod-1-cons-100-rp} |
---|
542 | \end{figure} |
---|
543 | |
---|
544 | %mem-1-prod-1-cons-100-tbb.eps |
---|
545 | \begin{figure} |
---|
546 | \centering |
---|
547 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/mem-1-prod-1-cons-100-tbb} } |
---|
548 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/mem-1-prod-1-cons-100-tbb} } |
---|
549 | \caption{Memory benchmark results with 1 producer for tbb memory allocator} |
---|
550 | \label{fig:mem-1-prod-1-cons-100-tbb} |
---|
551 | \end{figure} |
---|
552 | |
---|
553 | %mem-4-prod-4-cons-100-cfa.eps |
---|
554 | \begin{figure} |
---|
555 | \centering |
---|
556 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/mem-4-prod-4-cons-100-cfa} } |
---|
557 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/mem-4-prod-4-cons-100-cfa} } |
---|
558 | \caption{Memory benchmark results with 4 producers for cfa memory allocator} |
---|
559 | \label{fig:mem-4-prod-4-cons-100-cfa} |
---|
560 | \end{figure} |
---|
561 | |
---|
562 | %mem-4-prod-4-cons-100-dl.eps |
---|
563 | \begin{figure} |
---|
564 | \centering |
---|
565 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/mem-4-prod-4-cons-100-dl} } |
---|
566 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/mem-4-prod-4-cons-100-dl} } |
---|
567 | \caption{Memory benchmark results with 4 producers for dl memory allocator} |
---|
568 | \label{fig:mem-4-prod-4-cons-100-dl} |
---|
569 | \end{figure} |
---|
570 | |
---|
571 | %mem-4-prod-4-cons-100-glc.eps |
---|
572 | \begin{figure} |
---|
573 | \centering |
---|
574 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/mem-4-prod-4-cons-100-glc} } |
---|
575 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/mem-4-prod-4-cons-100-glc} } |
---|
576 | \caption{Memory benchmark results with 4 producers for glibc memory allocator} |
---|
577 | \label{fig:mem-4-prod-4-cons-100-glc} |
---|
578 | \end{figure} |
---|
579 | |
---|
580 | %mem-4-prod-4-cons-100-hrd.eps |
---|
581 | \begin{figure} |
---|
582 | \centering |
---|
583 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/mem-4-prod-4-cons-100-hrd} } |
---|
584 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/mem-4-prod-4-cons-100-hrd} } |
---|
585 | \caption{Memory benchmark results with 4 producers for hoard memory allocator} |
---|
586 | \label{fig:mem-4-prod-4-cons-100-hrd} |
---|
587 | \end{figure} |
---|
588 | |
---|
589 | %mem-4-prod-4-cons-100-je.eps |
---|
590 | \begin{figure} |
---|
591 | \centering |
---|
592 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/mem-4-prod-4-cons-100-je} } |
---|
593 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/mem-4-prod-4-cons-100-je} } |
---|
594 | \caption{Memory benchmark results with 4 producers for je memory allocator} |
---|
595 | \label{fig:mem-4-prod-4-cons-100-je} |
---|
596 | \end{figure} |
---|
597 | |
---|
598 | %mem-4-prod-4-cons-100-pt3.eps |
---|
599 | \begin{figure} |
---|
600 | \centering |
---|
601 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/mem-4-prod-4-cons-100-pt3} } |
---|
602 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/mem-4-prod-4-cons-100-pt3} } |
---|
603 | \caption{Memory benchmark results with 4 producers for pt3 memory allocator} |
---|
604 | \label{fig:mem-4-prod-4-cons-100-pt3} |
---|
605 | \end{figure} |
---|
606 | |
---|
607 | %mem-4-prod-4-cons-100-rp.eps |
---|
608 | \begin{figure} |
---|
609 | \centering |
---|
610 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/mem-4-prod-4-cons-100-rp} } |
---|
611 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/mem-4-prod-4-cons-100-rp} } |
---|
612 | \caption{Memory benchmark results with 4 producers for rp memory allocator} |
---|
613 | \label{fig:mem-4-prod-4-cons-100-rp} |
---|
614 | \end{figure} |
---|
615 | |
---|
616 | %mem-4-prod-4-cons-100-tbb.eps |
---|
617 | \begin{figure} |
---|
618 | \centering |
---|
619 | \subfigure[Algol]{ \includegraphics[width=0.9\textwidth]{evaluations/algol-perf-eps/mem-4-prod-4-cons-100-tbb} } |
---|
620 | \subfigure[Nasus]{ \includegraphics[width=0.9\textwidth]{evaluations/nasus-perf-eps/mem-4-prod-4-cons-100-tbb} } |
---|
621 | \caption{Memory benchmark results with 4 producers for tbb memory allocator} |
---|
622 | \label{fig:mem-4-prod-4-cons-100-tbb} |
---|
623 | \end{figure} |
---|
624 | |
---|
625 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
626 | %% ANALYSIS |
---|
627 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|