Lumar
Lumar

Reputation: 11

How to know that a process ends with "out of memory" error?

I have one C++ program that runs another program in a separate process, which does extensive calculations.

How can I know if this other process crashed because of an "out of memory" error?

I use QProcess and QLocalSocket.

Upvotes: 0

Views: 597

Answers (1)

Alexey
Alexey

Reputation: 2479

You cannot get the reason for the crash of a running process executed by QProcess. You can only be informed that it finished (normally or crashed) or that an error occured during execution.

All that can be handled by processing QProcess signals

  1. void QProcess::errorOccurred(QProcess::ProcessError error)
  2. void QProcess::finished(int exitCode, QProcess::ExitStatus exitStatus = NormalExit)

Please, refer to the official documentation.

Upvotes: 1

Related Questions