AdguardForMac icon indicating copy to clipboard operation
AdguardForMac copied to clipboard

Very high CPU usage in Mail.app

Open letheed opened this issue 3 years ago • 21 comments

I’m seeing very high (100%) CPU usage in Mail.app.

The behaviour is a bit random. Typically it will work properly several hours and suddenly I will notice my MacBook gets hot. Most of the time it happens at some point during the night and I find it hot in the morning. It seems that Mail.app has trouble connecting and gets stuck in a loop somewhere. I have to force quit it.

I think it started with AdGuard 2.6. It started on Big Sur, and still happens in Monterey.

This seems similar to #928.

I have no antivirus, firewall or other network related software installed. I’m running a fresh 12.0.1 install on an M1 MB Air.

I sent a bug report. Ticket number is 548998.

Below is a screenshot of Mail.app with an error message saying the connection expired. It think iCloud and Yahoo (top and bottom) are affected but not Outlook/Exchange.

Capture d’écran Mail app 2021-10-24 à 17 57 06

letheed avatar Oct 30 '21 20:10 letheed

Hello there!

Could you check if the issue repeats if you run mail.app after running AdGuard protection?

If starting Mail.app while AdGuard protection is already running helps, it is the AdguardTeam/CoreLibs#1436.

Chinaski1 avatar Nov 01 '21 14:11 Chinaski1

@Chinaski1 AdGuard launches automatically on startup and I open Mail.app manually after that so if I understand what you are saying correctly Mail.app always runs after AdGuard. It has not helped so far.

letheed avatar Nov 02 '21 20:11 letheed

I have been trying to reproduce this issue for a few days, but have not noticed this behaviour.

So I would like to ask you to take a Sample if you notice a recurrence of this situation. (100& CPU load)

  • Activity monitor -> Choose Mail.app -> Click on Sample -> Send received txt file to [email protected]
  • Is the issue reproduced only with DNS filtering ON?

Chinaski1 avatar Nov 12 '21 16:11 Chinaski1

@Chinaski1 Apologies for the delay. I have sent the sample. I can confirm that the issue happens even with dns filtering off. I have no other adblocker, firewall, antivirus or network related extension installed. There is no profile installed, I have manually checked that the dns is my ISP’s.

letheed avatar Nov 25 '21 13:11 letheed

I also have the same issue.

shiltian avatar Dec 22 '21 14:12 shiltian

Hello, I appear to have hit the very same issue this morning. Restarting Mail.app made it stop. It may have been an interaction with my VPN software as well.

I'm posting here mostly so I can find this Github issue in future, if it happens again I will try to provide more debugging info.

The only thing I can mention is that while Mail.app was at 100%, looking in Console there were endless identical nw_socket_handle_socket_event messages, all with READ_CLOSE in them.

spinicist avatar Feb 08 '22 09:02 spinicist

@sfionov @Stillness-2 guys, this looks like a consequence of using tcpkill to mitigate the old Network Extensions bug.

Can we simply exempt Mail.app from the tcpkill's scope?

ameshkov avatar Feb 08 '22 09:02 ameshkov

I had to exclude the mail app from AdGuard to resolve the issue.

Exclude_Mail

grovolis avatar Feb 23 '22 09:02 grovolis

@sfionov it seems that my original assumption about tcpkill might be wrong. Any idea what could it be?

ameshkov avatar Feb 24 '22 08:02 ameshkov

Yep, it doesn't seem to be tcpkill problem. May be an Apple bug. However, they pushed some fixes for transparent proxy since 12.0.1.

@letheed @grovolis Can you please retry to test it with the latest macOS version?

sfionov avatar Apr 20 '22 19:04 sfionov

Yep, it doesn't seem to be tcpkill problem. May be an Apple bug. However, they pushed some fixes for transparent proxy since 12.0.1.

@letheed @grovolis Can you please retry to test it with the latest macOS version?

I'd love to but I've sold my Mac while I wait for my new one to come in.

Might be more than a month before I can test this.

grovolis avatar Apr 21 '22 06:04 grovolis

I was able to reproduce this today on macOS 12.3.1.

letheed avatar Apr 21 '22 18:04 letheed

I was having the same issue today. I use macOS 12.3.1. Disabling "Protect Mail Activity" and "Hide IP Address" seemed to solve the problem.

dannilocruz avatar Apr 30 '22 20:04 dannilocruz

I was having the same issue today. I use macOS 12.3.1. Disabling "Protect Mail Activity" and "Hide IP Address" seemed to solve the problem.

~~This seems to be working for me too!~~ Edit: The problem seems to be back, adding mail.app to the exclusions again.

grovolis avatar May 01 '22 06:05 grovolis

I was having the same issue today. I use macOS 12.3.1. Disabling "Protect Mail Activity" and "Hide IP Address" seemed to solve the problem.

~This seems to be working for me too!~ Edit: The problem seems to be back, adding mail.app to the exclusions again.

I came to a hasty conclusion. The problem is back for me too. I'll add mail.app to the exclusions.

dannilocruz avatar May 01 '22 10:05 dannilocruz

Yes, I have kept "Private Relay (beta)" disabled so far, and I’ve tried disabling "Protect my mail activity" before, it has always come back. Only excluding Mail.app from filtering has had an effect so far.

letheed avatar May 01 '22 14:05 letheed

May be related to https://github.com/AdguardTeam/CoreLibs/issues/1643

sfionov avatar Jun 15 '22 08:06 sfionov

Still happens with CoreLibs 1.10.113.

Schaefers avatar Oct 30 '22 11:10 Schaefers

Happening with AdGuard 2.10.1.1277 (CoreLibs version 1.11.98, DNSLibs version 2.1.38) with macOS Ventura 13.4.1.

validatedev avatar Jun 28 '23 16:06 validatedev

@validatedev Can you please say what type of email service is configured in your Mail app? IMAPS, POPS, Exchange/Outlook Web Access or something else?

sfionov avatar Jun 28 '23 16:06 sfionov

Sure. I have 5 IMAPs (4 Google, 1 iCloud) and 1 Exchange. Thanks for the interest, by the way.

validatedev avatar Jun 28 '23 17:06 validatedev