diff options
author | Jay Berkenbilt <jberkenbilt@users.noreply.github.com> | 2022-08-31 21:50:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-31 21:50:17 +0200 |
commit | a078202c1b5823f1c13a4c559619158054029e73 (patch) | |
tree | fd47549657238cc532768dd19b1eb9fffb5b0269 /libqpdf/QPDFJob.cc | |
parent | 7b3134ef94db6ae1ca17c6d2dd4843322b7546c5 (diff) | |
parent | 4aac7c325acbf80ed4a6fc121c5a36f2d5515ff1 (diff) | |
download | qpdf-a078202c1b5823f1c13a4c559619158054029e73.tar.zst |
Merge pull request #752 from jberkenbilt/report-mem-usage
Report mem usage
Diffstat (limited to 'libqpdf/QPDFJob.cc')
-rw-r--r-- | libqpdf/QPDFJob.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libqpdf/QPDFJob.cc b/libqpdf/QPDFJob.cc index 15a81854..7bd563aa 100644 --- a/libqpdf/QPDFJob.cc +++ b/libqpdf/QPDFJob.cc @@ -417,7 +417,8 @@ QPDFJob::Members::Members() : check_is_encrypted(false), check_requires_password(false), json_input(false), - json_output(false) + json_output(false), + report_mem_usage(false) { } @@ -625,6 +626,14 @@ QPDFJob::run() << ": operation succeeded with warnings\n"; } } + if (m->report_mem_usage) { + // Call get_max_memory_usage before generating output. When + // debugging, it's easier if print statements from + // get_max_memory_usage are not interleaved with the output. + auto mem_usage = QUtil::get_max_memory_usage(); + *this->m->log->getWarn() + << "qpdf-max-memory-usage " << mem_usage << "\n"; + } } bool |