AdguardForWindows icon indicating copy to clipboard operation
AdguardForWindows copied to clipboard

Memory leakage and CPU overkill

Open GerhardSauer opened this issue 1 year ago • 20 comments

Please answer the following questions for yourself before submitting an issue

  • [X] Filters were updated before reproducing an issue
  • [X] I checked the knowledge base and found no answer
  • [X] I checked to make sure that this issue has not already been filed

AdGuard version

7.17.4709.0

Browser version

Edge 126.0.2592.87

OS version

Windows 11 23H2 Build 22631.3737

Traffic filtering

  • [X] yes, I do

Ad Blocking

No response

Privacy

No response

Social

No response

Annoyances

No response

Security

No response

Other

No response

Language-specific

No response

Which DNS server do you use?

DNS protection disabled

DNS protocol

Regular

Custom DNS

No response

What Stealth Mode options do you have enabled?

No response

Support ticket ID

No response

Issue Details

Steps to reproduce:

  1. use the following filter rules and set exceptions where needed: |http$subdocument |http$third-party,script,object,media,websocket,xmlhttprequest
  2. close and re-open filtering log every day
  3. keep the machine running

Expected Behavior

no memory leak or CPU overkill

Actual Behavior

memory leakage and CPU overkill

Screenshots

Screenshot 1

image

image

Additional Information

Machine is currently running 12 days. CPU overkill stopped, when I closed the filtering log. The CPU overkill happened today for the first time.

I reported already in here as well (AdguardSvc.exe is using 4.5GB of RAM #5016 ) Version 7.18 is not released as msi installer yet.

GerhardSauer avatar Jul 12 '24 23:07 GerhardSauer

@GerhardSauer hello, could you try a new build.

Aydinv13 avatar Jul 15 '24 10:07 Aydinv13

Ok, I installed the new version and will come back with results after some days.

GerhardSauer avatar Jul 15 '24 11:07 GerhardSauer

@GerhardSauer how is it going?

Aydinv13 avatar Jul 22 '24 07:07 Aydinv13

@GerhardSauer how is it going? I had to restart the machine several times, thats why I'm writing now. Currently 5 days uptime. image

Definitively better, but still growing. The CPU extreme usage did not happen so far.

GerhardSauer avatar Jul 24 '24 17:07 GerhardSauer

Could you please grab the Debugs logs for us:

  1. Collect the debug log as it's explained here.
  2. Remember the exact time when the issue was reproduced. We will need it to find the corresponding records in the log file.
  3. Send the archive to [email protected] and mention this issue number(5173) in the subject.

Aydinv13 avatar Jul 25 '24 08:07 Aydinv13

email with logs is sent. (containing CPU issues, it occurs with the provided version as well) after 10 days, service is again at 7.5 GB commit size memory. In case, I have a memory dump as well.

relevant log time is 29.07.2024 between 21:24:20 ~ 21:24:45 CEST.

GerhardSauer avatar Jul 29 '24 19:07 GerhardSauer

Hello, I close it every day, but during the day, I have it open, as I need to add new rules several times a day.

With kind regards, Gerhard Sauer

From: vankos @.> Sent: Friday, August 9, 2024 11:52 AM To: AdguardTeam/AdguardForWindows @.> Cc: Gerhard M.T.H. Sauer @.>; Mention @.> Subject: Re: [AdguardTeam/AdguardForWindows] Memory leakage and CPU overkill (Issue #5173)

@GerhardSauerhttps://github.com/GerhardSauer, hello! Do I understand correctly that you keep the filtering log open all day?

Reply to this email directly, view it on GitHubhttps://github.com/AdguardTeam/AdguardForWindows/issues/5173#issuecomment-2277579058, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADTVF3JORQOC3RI2ID4OURTZQSGLPAVCNFSM6AAAAABKZWIWNGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZXGU3TSMBVHA. You are receiving this because you were mentioned.Message ID: @.***>

GerhardSauer avatar Aug 09 '24 10:08 GerhardSauer

Hi! We found a few potential places that could be causing the leakage. Could you please try this test build and let us know if the problem persists? https://uploads.adguard.org/AdGuard-v7.19.4799.4.exe

vankos avatar Aug 20 '24 07:08 vankos

Hi! We found a few potential places that could be causing the leakage. Could you please try this test build and let us know if the problem persists? https://uploads.adguard.org/AdGuard-v7.19.4799.4.exe

yes, i will test, thank you.

GerhardSauer avatar Aug 20 '24 08:08 GerhardSauer

4 days runtime, 3,7 gb commit size CPU overkill did not happen so far.

GerhardSauer avatar Aug 26 '24 21:08 GerhardSauer

what ever you did, made it worse. @vankos 7 days 17 hours runtime commit size over 74 GB image

GerhardSauer avatar Aug 30 '24 13:08 GerhardSauer

Hello, @GerhardSauer,

We need more information to resolve the issue. I have sent instructions to the email you used to send us the dump files, guiding you on how to collect additional data.

vankos avatar Sep 02 '24 11:09 vankos

Profiling is running. I will get back to you as soon as the commit size is bigger.

GerhardSauer avatar Sep 02 '24 12:09 GerhardSauer

@GerhardSauer, we received the snapshots, thanks. I see that the leak is non-linear. Could you tell me, if you recall, if you started doing something differently around 8:00 - 10:00 UTC? Maybe you began adding rules, watching videos, or working with the filtering log etc?

Can you observe if memory consumption still grows if you don’t open the filtering log? (It’s the main suspect for now.)

Also, could you please send the logs for the period when you recorded snapshots to the same email? (You can just send the entire folder: C:\ProgramData\Adguard\Logs\)

vankos avatar Sep 06 '24 11:09 vankos

@vankos , I have uploaded the logs to the same share I sent you in the last email. I will monitor the memory size the next days without opening the filtering log (currently 2,6GB).

regarding the timing, I can not exactly remember what I did during that time frame. But I did not add much rules the last days.

GerhardSauer avatar Sep 06 '24 12:09 GerhardSauer

@vankos 3 days later, the commit size is still 2,69 GB. So main increases are related to the filtering log. As I did not write down the exact number the last time, the maximum possible increase is 90 MB or less.

GerhardSauer avatar Sep 09 '24 11:09 GerhardSauer

@GerhardSauer, hello! Sorry for the delayed response. We made some changes in the native libraries that could potentially fix the issue. Could you please update to the latest nightly build and check if the problem still persists? https://agrd.io/windows_nightly

vankos avatar May 20 '25 11:05 vankos

I'm testing now.

GerhardSauer avatar May 23 '25 19:05 GerhardSauer

@vankos memory leak is still there, but the growth rate is much less and sometimes the commited value reduced a bit.

GerhardSauer avatar Jun 04 '25 17:06 GerhardSauer

Thank you for the test! What is the current growth rate? How much is this occasional reduction?

Could you please collect dump files for us again? Since we cannot reproduce the problem on our side, we rely on your help to resolve it. Unfortunately, we cannot use the old dump files, as the codebase has changed significantly since they were collected. I’ve prepared the necessary batch files for you: https://uploads.adguard.org/Procdump.rar

Please follow these steps:

  1. Extract the archive and run run.bat when the AdGuard commit size is normal.
  2. The script will: * Immediately create the first .dmp file. * After that script will wait until the AdguardSvc.exe commit size reaches 1.5 GB, then create the second .dmp file.
  3. Just leave run.bat running until the second dump is created.

Once both files are generated, please upload them to the file share you used previously or any other convenient method, and let us know.

vankos avatar Jun 19 '25 12:06 vankos

@GerhardSauer, we hope that the issue went away with the latest build. Feel free to reopen the issue (or create the new one) if the issue persist

adbuker avatar Jul 08 '25 11:07 adbuker