From f9ffc72f5db0537f6a2e13d09932e6192023d778 Mon Sep 17 00:00:00 2001 From: Carlos O'Donell Date: Oct 16 2016 10:57:56 +0000 Subject: Add a sparse plot for VmRSS vs Ideal RSS. --- diff --git a/trace_plot.m b/trace_plot.m index 738490e..c90eb08 100644 --- a/trace_plot.m +++ b/trace_plot.m @@ -73,8 +73,8 @@ plot (data_allocs, 'o', 'linewidth', plot_line_width); h=get(gcf, "currentaxes"); set(h, "fontsize", font_size, "linewidth", plot_line_width); data_allocs_min = 1; -data_allocs_max = 2000260; -data_allocs_mean = 556; +data_allocs_max = 27378856; +data_allocs_mean = 69; min_str = sprintf ("Min: %lu byte(s)", data_allocs_min); max_str = sprintf ("Max: %lu bytes", data_allocs_max); mean_str = sprintf ("Mean: %lu bytes", data_allocs_mean); @@ -83,6 +83,13 @@ xlabel (sprintf ("Event # (%lu:1 down sampling)", down_sample_ratio)); ylabel ("Allocation Request Size (bytes)"); title ("Allocation Request Sizes"); +# We have two options, plot all 3 variables, or just two. +# When might you set full_plot to 0? When you want to zoom around and view +# parts of VmRSS and Ideal RSS and capture some images without VmSize getting +# in the way. +full_plot = 1; +if (full_plot == 1) +################################################################################ # Plot 2: # Plot the mean VmSize, VmRSS, and ideal RSS across the downsampled ranges # for the trace over event tick time (not real time). @@ -109,7 +116,6 @@ plot (ax(1), x, data_ideal_rss(:,idx_mean), "color", "black", 'linewidth', plot_ h=get(gcf, "currentaxes"); set(h, "fontsize", font_size, "linewidth", tick_line_width); legend ("Ideal RSS Size", "RSS Size", "Virtual Address Size", "location", plot2_legend_loc); - # Linear regression of mean Ideal RSS samples. block_start = 1000; block_end = 24000; @@ -131,6 +137,32 @@ x = x'; X = [ones(m, 1) x]; theta_vmrss = (pinv(X'*X))*X'*y; plot(X(:,2), X*theta_vmrss, '-', "color", "green", 'linewidth', plot_line_width); +################################################################################ +else +################################################################################ +# Plot 2: +# Plot just mean VmRSS, and ideal RSS across the downsampled ranges +# for the trace over event tick time (not real time). +samples=length (data_vmrss(:,idx_mean)); +x = linspace (1, samples, samples); +figure (2, "Position", [figure_x, figure_y, figure_width, figure_height]); +h1 = plot (x, (data_vmrss(:,idx_mean) * pagesz) - bias, 'marker', '*'); +ax(1) = gca(); +set(h1, "color", "blue"); +set(ax(1), "ycolor", "black"); +set(h1, 'linewidth', plot_line_width); +set(ax(1), "fontsize", font_size, "linewidth", plot_line_width); +xlabel (sprintf ("Event # (%lu:1 down sampling)", down_sample_ratio)); +ylabel (ax(1), "RSS Size (bytes)"); +title ("Memory usage over time"); +hold on; +plot (ax(1), x, data_ideal_rss(:,idx_mean), "color", "black", 'linewidth', plot_line_width, 'marker', '*'); +h=get(gcf, "currentaxes"); +set(h, "fontsize", font_size, "linewidth", tick_line_width); +legend ("RSS Size", "Ideal RSS Size", "location", plot2_legend_loc); +################################################################################ +endif + hold off;