aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFJob.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libqpdf/QPDFJob.cc')
-rw-r--r--libqpdf/QPDFJob.cc11
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