Skip to content

System::Print RAM consuming #21

@ehsan1011

Description

@ehsan1011

What were you trying to do?

Hi,
The problem is that every time a print job is executed, a new Electron process appears in Windows Task Manager and doesn't get terminated after printing. When I perform a large number of prints (e.g., 100) in 5 hours, 100 Electron processes accumulate in Task Manager, consuming all available RAM and eventually causing the application to crash.

How can I fix this?

$print = $request->print;
$defaultPrinter = null;
$printers = System::printers();
foreach ($printers as $printer) {
if ($printer->isDefault) {
$defaultPrinter = $printer;
break;
}
}
if ($defaultPrinter) {
$defaultPrinter->options['pageSize'] = 'AA';
$defaultPrinter->options['silent'] = true;
System::print($print, $defaultPrinter);
echo $print;
} else {
echo 'Default printer not found!';
}

What happened?

How to reproduce the bug

Debug Output

Which operating systems have you seen this occur on?

No response

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions