[GH-ISSUE #82] getAllClasses() goes in a loop #54

Open
opened 2026-03-03 19:11:22 +03:00 by kerem · 8 comments
Owner

Originally created by @andy3a on GitHub (Aug 17, 2021).
Original GitHub issue: https://github.com/ProxymanApp/atlantis/issues/82

Originally assigned to: @NghiaTranUIT on GitHub.

Hi Nghia,

I faced with the situation when device/simulator starts consuming huge memory amount and hangs as a result. I don't know why this happens, because this is not a persistent issue and it appears from time to time (I don't see specific cause).

This is the evidence from Debug navigator:
image

And as per profiler looks like getAllClasses is responsible for that:
image
so there are more than 40 000 calls of it...

device iOS version: 14.6 (reproduced for simulators as well)
Xcode: Version 12.5.1 (12E507)

please let me know I should provide some more details

Thanks,
Andrew

Originally created by @andy3a on GitHub (Aug 17, 2021). Original GitHub issue: https://github.com/ProxymanApp/atlantis/issues/82 Originally assigned to: @NghiaTranUIT on GitHub. Hi Nghia, I faced with the situation when device/simulator starts consuming huge memory amount and hangs as a result. I don't know why this happens, because this is not a persistent issue and it appears from time to time (I don't see specific cause). This is the evidence from Debug navigator: ![image](https://user-images.githubusercontent.com/87482167/129703252-863975aa-1e08-4490-bef0-891b03a84d26.png) And as per profiler looks like getAllClasses is responsible for that: ![image](https://user-images.githubusercontent.com/87482167/129704010-68d224ca-8f47-4766-bfe5-4a81d094d489.png) so there are more than 40 000 calls of it... device iOS version: 14.6 (reproduced for simulators as well) Xcode: Version 12.5.1 (12E507) please let me know I should provide some more details Thanks, Andrew
Author
Owner

@NghiaTranUIT commented on GitHub (Aug 17, 2021):

Hey @andy3a thanks for your report.

Runtime.getAllClasses() should only be executed once when the app is starting. If it executes multiple times (as your screenshot), I suppose there is a bug somewhere.

I will replace it with a better version and send you a beta this week 👍

<!-- gh-comment-id:900176738 --> @NghiaTranUIT commented on GitHub (Aug 17, 2021): Hey @andy3a thanks for your report. `Runtime.getAllClasses()` should only be executed **once** when the app is starting. If it executes multiple times (as your screenshot), I suppose there is a bug somewhere. I will replace it with a better version and send you a beta this week 👍
Author
Owner

@NghiaTranUIT commented on GitHub (Aug 17, 2021):

Just wondering:

  1. Are you using any 3rd-party networking library? such as AFNetworking, or Alamofire? If yes, what version?

I would like to reproduce it in my machine 💻

<!-- gh-comment-id:900179372 --> @NghiaTranUIT commented on GitHub (Aug 17, 2021): Just wondering: 1. Are you using any 3rd-party networking library? such as AFNetworking, or Alamofire? If yes, what version? I would like to reproduce it in my machine 💻
Author
Owner

@andy3a commented on GitHub (Aug 17, 2021):

yes, I'm using Alamofire 5.4.3

<!-- gh-comment-id:900187161 --> @andy3a commented on GitHub (Aug 17, 2021): yes, I'm using Alamofire 5.4.3
Author
Owner

@NghiaTranUIT commented on GitHub (Aug 17, 2021):

Hey @andy3a if you don't mind, please check out this commit and share with me if it works for you 👍

Changelog

  • Use a different version to get all classes that conforms NSURLConnectionDelegate in runtime

SMP

  • Check out this commit: 70425e4a0895ec483dfdb5b99cfba91bec6ac935
    Screen Shot 2021-08-17 at 20 22 06

Cocoapod

pod 'atlantis-proxyman', :git => 'https://github.com/ProxymanApp/atlantis.git', :commit => '70425e4a0895ec483dfdb5b99cfba91bec6ac935'
<!-- gh-comment-id:900298253 --> @NghiaTranUIT commented on GitHub (Aug 17, 2021): Hey @andy3a if you don't mind, please check out this commit and share with me if it works for you 👍 ### Changelog - Use a different version to get all classes that conforms NSURLConnectionDelegate in runtime ### SMP - Check out this commit: `70425e4a0895ec483dfdb5b99cfba91bec6ac935` <img width="569" alt="Screen Shot 2021-08-17 at 20 22 06" src="https://user-images.githubusercontent.com/5878421/129733432-212c18cd-e805-468c-87a4-be61eda0524f.png"> ### Cocoapod ``` pod 'atlantis-proxyman', :git => 'https://github.com/ProxymanApp/atlantis.git', :commit => '70425e4a0895ec483dfdb5b99cfba91bec6ac935' ```
Author
Owner

@andy3a commented on GitHub (Aug 17, 2021):

thanks for you effort @NghiaTranUIT

successfully deployed the commit.

I'll need to use it for couple days to see if the issue can be reproduced unless you know how to reproduce the situation when the issue appeared in previous version

cheers

<!-- gh-comment-id:900328983 --> @andy3a commented on GitHub (Aug 17, 2021): thanks for you effort @NghiaTranUIT successfully deployed the commit. I'll need to use it for couple days to see if the issue can be reproduced unless you know how to reproduce the situation when the issue appeared in previous version cheers
Author
Owner

@andy3a commented on GitHub (Aug 17, 2021):

hi @NghiaTranUIT,

I have reproduced the issue:
image
image
image

<!-- gh-comment-id:900431006 --> @andy3a commented on GitHub (Aug 17, 2021): hi @NghiaTranUIT, I have reproduced the issue: ![image](https://user-images.githubusercontent.com/87482167/129761399-a07c0325-ced7-4653-886d-cc09b95cc9a2.png) ![image](https://user-images.githubusercontent.com/87482167/129761493-121a15fa-7186-40d2-ad78-8747d42333d5.png) ![image](https://user-images.githubusercontent.com/87482167/129761644-ee3bdaa2-e827-4f39-8c1d-44f11cceda65.png)
Author
Owner

@NghiaTranUIT commented on GitHub (Aug 18, 2021):

It's odd that this array of AnyClass doesn't release when it exits the function 🤔

@andy3a Please try this commit 29088bc9b752498cdb74051c962855f2de77e52a, which I disable the Method Swizzling on NSURLConnection.

<!-- gh-comment-id:900849682 --> @NghiaTranUIT commented on GitHub (Aug 18, 2021): It's odd that this array of AnyClass doesn't release when it exits the function 🤔 @andy3a Please try this commit `29088bc9b752498cdb74051c962855f2de77e52a`, which I disable the Method Swizzling on NSURLConnection.
Author
Owner

@andy3a commented on GitHub (Aug 23, 2021):

Hi @NghiaTranUIT,

I'm sorry but the issue has been reproduced again.

image

... for the latest fix provided
image

I could provide some details form Profiler if needed. Feel free to request the data you may need for investigation.

p.s. could it be like I do smth wrong? itbh I don't see where I could do anything wrong, but maybe you have an idea...

Andy

<!-- gh-comment-id:904061517 --> @andy3a commented on GitHub (Aug 23, 2021): Hi @NghiaTranUIT, I'm sorry but the issue has been reproduced again. ![image](https://user-images.githubusercontent.com/87482167/130507244-142ae151-33b7-4f94-9701-da869d4209cc.png) ... for the latest fix provided ![image](https://user-images.githubusercontent.com/87482167/130507371-4dedc47d-2329-4cbd-a39c-4308c4d092dd.png) I could provide some details form Profiler if needed. Feel free to request the data you may need for investigation. p.s. could it be like I do smth wrong? itbh I don't see where I could do anything wrong, but maybe you have an idea... Andy
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/atlantis#54
No description provided.