src/cxx_supportlib/Utils/ProcessMetricsCollector.h in passenger-5.3.4 vs src/cxx_supportlib/Utils/ProcessMetricsCollector.h in passenger-5.3.5
- old
+ new
@@ -319,21 +319,24 @@
pidsArg.c_str(),
#endif
NULL
};
- string psOutput = this->psOutput;
- if (psOutput.empty()) {
+ SubprocessOutput psOutput;
+ psOutput.data = this->psOutput;
+ if (psOutput.data.empty()) {
SubprocessInfo info;
- runCommandAndCaptureOutput(command, info, psOutput, true, afterFork);
- if (psOutput.empty()) {
+ runCommandAndCaptureOutput(command, info, psOutput,
+ 1024 * 1024, true, afterFork);
+ if (psOutput.data.empty()) {
throw RuntimeException("The 'ps' command failed");
}
}
pidsArg.resize(0);
fmtArg.resize(0);
- ProcessMetricMap result = parsePsOutput<Collection, ConstIterator>(psOutput, pids);
- psOutput.resize(0);
+ ProcessMetricMap result = parsePsOutput<Collection, ConstIterator>(
+ psOutput.data, pids);
+ psOutput.data.resize(0);
if (canMeasureRealMemory) {
ProcessMetricMap::iterator it;
for (it = result.begin(); it != result.end(); it++) {
ProcessMetrics &metric = it->second;
measureRealMemory(metric.pid, metric.pss,