QZ is using 80% CPU, something wrong going

7 views
Skip to first unread message

Alex

unread,
Feb 23, 2024, 3:35:58 PMFeb 23
to qz-p...@googlegroups.com, sup...@qz.io
Hi,

I am using Qz for developing an app and I am experiencing a weird
behavior that once every 30-60 minutes the CPU get's smashed
by openJDK that's running qz on, using 80% CPU on an I7.

I thank you very much for the great software you developed and I am
trying to raise some money from the community to buy the premium support
for the open-source application I developed that does printing as well.

Maybe you can shine some light on what's going wrong to know what to
tell my users in case it happens on their end as well.

I am running on windows 10 machine and I used the code you provided for
demo.

After I reload the Qz from the tray, openjdk goes to 0 cpu usage and
just ram usage 400 Mb, which is ok

Looking forward for your reply!

All the best!

Alex

Lite Finocchiaro

unread,
Feb 23, 2024, 5:11:39 PMFeb 23
to Alex, qz-p...@googlegroups.com, sup...@qz.io
Alex:

Would you mind sending logs?

Advanced, Troubleshooting, Zip Logs (To Desktop)

We found a bug recently that involved checking printer status, but it generally only occurred on Mac. If you're seeing this on Windows, there may be a bad driver on the PC, or the printer may have changed IP addresses, which will make QZ-Tray crash in some instances.

Anything else you can tell us about your environment will be helpful.

Regards,

Lite Finocchiaro
VP, QZ Industries

--
You received this message because you are subscribed to the Google Groups "qz-print" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qz-print/4572789e-b6ba-4f45-af42-6ce66ae06a3d%40gmail.com.

Alex

unread,
Feb 24, 2024, 1:24:44 AMFeb 24
to Lite Finocchiaro, qz-p...@googlegroups.com, sup...@qz.io

Hi,

Thanks for your reply!

I attached screenshot and logs.

I saw something mentioning both certificates so I removed the localhost one.

I will see if it persist and begin removing printers one by one.

Let me know if there's other ways to debug this or if you find anything useful in the logs.


Alex

task manager.JPG
qz-2024-02-24_0819.zip

Tres Finocchiaro

unread,
Feb 24, 2024, 6:09:27 PMFeb 24
to Alex, Lite Finocchiaro, qz-p...@googlegroups.com, sup...@qz.io
every 30-60 minutes the CPU get's smashed

What do you mean "smashed"?  For example, how long is it peaking for?

If you examine the logs, you'll notice that we check for a valid SSL certificate once an hour.  Does it coincide with those events?

Which version?

-Tres
 


Tres Finocchiaro

unread,
Feb 25, 2024, 10:08:21 AMFeb 25
to Alexandru Gradea, qz-print
+qz-print 

Hi,

What version?  The more you can share the better.  If needed, we can run a debugger on your machine to find the root cause.

-Tres

On Sat, Feb 24, 2024 at 7:55 PM Alexandru Gradea <deepcyc...@gmail.com> wrote:
Hi,

Is using 80% all the time until I click reload on the qz tray. I removed the localhost certificate but was still doing it.

I started removing printers, got to one note desktop. Still need to see if it  happens. Will see tomorrow.

But is periodical, looks like it coincides with a pattern, certificate checking or something else.

I will try to time it next time.

Alex

unread,
Feb 26, 2024, 1:00:44 AMFeb 26
to Tres Finocchiaro, qz-print

Hi,

I am using version 2.2.3 (Java) and it says that's the latest version.

Issue still happening. I removed offline printer, but no changes.

Let me know what can do to run the debugger.

Alex

Tres Finocchiaro

unread,
Feb 29, 2024, 10:17:18 AMFeb 29
to Alex, qz-print
Alex,

Unless you're already familiar with compiling the codebase, the debugger may not be intuitive to setup.

In short:
  1. IntelliJ IDEA Community Edition (free)
  2. OpenJDK 11 (configured on path). We use Liberica, but any will do.
  3. ANT (configured on path)
  4. GIT (to clone the source code)
JavaFX is a non-bundled dependency, so you need to run ant at least once from the source directory to download it.  Alternatively you can run download-javafx ant task from within IntelliJ.

IntelliJ has a "debug" icon which will start App.java in debug mode, however isolating the CPU spike may prove difficult because we're not yet certain where in the workflow to look.

I'd be happy to connect to your machine and do this interactively.  You can reach out to me directly at sup...@qz.io.

-Tres


Tres Finocchiaro

unread,
Feb 29, 2024, 2:03:03 PMFeb 29
to Alex, qz-print
Just a slight update on this... 

We checked various places in QZ Tray where background threads were spawned, none of which were able to reproduce the high CPU spike... 

1. SSL certificate check
 - Does not cause high CPU
2. Printer status
 - Not being invoked
3. Startup Tasks: JavaFX, Find Printers
 - Only called at startup

For now, you'll do a screen record to see if there's something observable in the logs at the time of the high CPU.  We'll be on standby as to your findings.
Reply all
Reply to author
Forward
0 new messages