Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 55c53f9

Browse files
committed
MNT: use engineering formatter for memory usage
1 parent 027a543 commit 55c53f9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

tools/memleak.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,13 @@ def run_memleak_test(bench, iterations, report):
5656
np.sum(rss_peaks[starti+1:] - rss_peaks[starti:-1]) / (endi - starti)))
5757

5858
from matplotlib import pyplot as plt
59+
from matplotlib.ticker import EngFormatter
60+
formatter0 = EngFormatter(unit='B')
5961
fig, (ax1, ax2, ax3) = plt.subplots(3)
6062
for ax in (ax1, ax2, ax3):
6163
ax.axvline(starti, linestyle='--', color='k')
6264
ax1b = ax1.twinx()
65+
ax1b.yaxis.set_major_formatter(formatter0)
6366
ax1.plot(malloc_arr, 'r')
6467
ax1b.plot(rss_arr, 'b')
6568
ax1.set_ylabel('pymalloc', color='r')

0 commit comments

Comments
 (0)