-
Notifications
You must be signed in to change notification settings - Fork 16
[Fix] #507 - 솝탬프 메모리 최적화 #510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wwdc 잘 적용해주셨네요!!
수고하셨습니다 :)
.processor(DownsamplingImageProcessor(size: self.bounds.size)), | ||
.scaleFactor(UIScreen.main.scale), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이미지 실제 크기가 아닌 UIImageView의 사이즈에 맞게 다운샘플링 하는거군요!
public init(type: NaviType) { | ||
super.init(frame: .zero) | ||
self.vc = vc | ||
self.setUI(type) | ||
self.setLayout(type) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 구조가 맞는 것 같아요 :) 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private func setAddTarget(_ ignorePopAction: Bool = false) { | ||
guard !ignorePopAction else { return } | ||
self.leftButton.addTarget(self, action: #selector(popToPreviousVC), for: .touchUpInside) | ||
// self.leftButton.addTarget(self, action: #selector(popToPreviousVC), for: .touchUpInside) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setAddTarget도 이제 사용되지 않는 것 같네요! (setAddTarget의 역할이 없어보여 setAddTarget 부분도 함께 제거해주세요 ! )
🌴 PR 요약
솝탬프 기능의 메모리 최적화를 진행했습니다.
🌱 작업한 브랜치
🌱 PR Point
1. 문제 상황 인지
2. 객체 개수 확인
NotificationCenter
와STNavigationBar
가 VC를 강하게 참조하고 있음을 알 수 있었습니다.2.1. NotificationCenter
AS-IS
TO-BE
NotificationCenter
가 Self를 약하게 참조하도록 변경했습니다. 또한 deinit할 때NotificationCenter.removeObserver()
도 호출해주고 있습니다.2.2. STNavigationBar
2.3. 그 외
3. memgraph - command line에서
vmmap summary
를 살펴보았을 때 ImageIO의 swapped size가 큰 메모리를 차지하고 있었고, 해당 화면의 이미지 관련 문제임을 유추할 수 있었습니다.3.1. Kingfisher 이미지 캐싱 시 다운샘플링
AS-IS
TO-BE
scaleFactor
로 이미지 크기 자체를 조정해 저장하고 있었는데,DownsamplingImageProcessor
로 ImageView의 사이즈로 다운샘플링하고 이미지 크기 자체는 해상도를 유지하도록 수정했습니다.4. 결과
📌 참고 사항
📸 스크린샷
생략
📮 관련 이슈