Navigation Controller not releasing memory, memory leak?Navigation arc memory not releasedMemory leak issue in navigation controllerMemory is not released during perform batch updates in CollectionViewHow can we navigate back to previous view programmatically in iPhone?Activity has leaked window that was originally addedCreating a memory leak with JavaperformSelector may cause a leak because its selector is unknowniOS10. Swift. UIPageViewController memory leaksShould “deinit” be called for initial view controller?How can I pass this custom class to new view controllerSimple iOS NavigationController + PDFViewer leaking 1.2 to 2 Mb of memory at each initialization. (Memory Leak)(Swift)NavigationController issue when picking image from galleryCycles in NavigationController - how to avoid memory leaks?

Answer with an image of my favorite musician

Why did Starhopper's exhaust plume become brighter just before landing?

Printing a list as "a, b, c." using Python

Cauterizing a wound with metal?

Do application leftovers have any impact on performance?

Is it recommended to point out a professor's mistake during their lecture?

Why do IR remotes influence AM radios?

Why did Lucius make a deal out of Buckbeak hurting Draco but not about Draco being turned into a ferret?

In Endgame, wouldn't Stark have remembered Hulk busting out of the stairwell?

Was a six-engine 747 ever seriously considered by Boeing?

Do multi-engine jets need all engines with equal age to reduce asymmetry in thrust and fuel consumption arising out of deterioration?

Can two aircraft stay on the same runway at the same time?

What is the difference between ?int $number and int $number = null?

Defending Castle from Zombies

How to handle inventory and story of a player leaving

Is it unusual for a math department not to have a mail/web server?

Can I lend a small amount of my own money to a bank at the federal funds rate?

Is this position a forced win for Black after move 14?

Why is there no Disney logo in MCU movies?

What's the point of fighting monsters in Zelda BotW?

Group riding etiquette

Why does `buck` mean `step-down`?

Normalized Malbolge to Malbolge translator

Are spot colors limited and why CMYK mix is not treated same as spot color mix?



Navigation Controller not releasing memory, memory leak?


Navigation arc memory not releasedMemory leak issue in navigation controllerMemory is not released during perform batch updates in CollectionViewHow can we navigate back to previous view programmatically in iPhone?Activity has leaked window that was originally addedCreating a memory leak with JavaperformSelector may cause a leak because its selector is unknowniOS10. Swift. UIPageViewController memory leaksShould “deinit” be called for initial view controller?How can I pass this custom class to new view controllerSimple iOS NavigationController + PDFViewer leaking 1.2 to 2 Mb of memory at each initialization. (Memory Leak)(Swift)NavigationController issue when picking image from galleryCycles in NavigationController - how to avoid memory leaks?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















Ive created a navigation which pushes a view controller that contains an image view and a button which adds the same view controller each time the button is tapped. After each tap the memory grows and after each back tap the memory is not released despite deinit being called. There is nothing in the code that points to a memory leak is there something I am missing thank you?



complete project repository



class ViewController: UIViewController 


lazy var nextButton:UIButton? =
let button = UIButton(type: .roundedRect)
button.setTitle("Next", for: .normal)
button.addTarget(self, action: #selector(nextButtonTapped), for: .touchUpInside)
button.translatesAutoresizingMaskIntoConstraints = false
button.backgroundColor = UIColor.red
return button
()

lazy var imageView:UIImageView? =
let image = #imageLiteral(resourceName: "DJI_0014")
let imageView = UIImageView(image: image)
imageView.translatesAutoresizingMaskIntoConstraints = false
return imageView
()

override func viewDidLoad()
super.viewDidLoad()
// Do any additional setup after loading the view.

guard let imageView = self.imageView, let nextButton = self.nextButton else
print("imageView, nextButton are nil")
return


self.view.backgroundColor = UIColor.white

self.view.addSubview(imageView)
NSLayoutConstraint.activate([
imageView.topAnchor.constraint(equalTo:self.view.topAnchor),
imageView.leadingAnchor.constraint(equalTo: self.view.leadingAnchor),
imageView.bottomAnchor.constraint(equalTo: self.view.bottomAnchor),
imageView.trailingAnchor.constraint(equalTo: self.view.trailingAnchor)])

view.addSubview(nextButton)
NSLayoutConstraint.activate([nextButton.centerXAnchor.constraint(equalTo: self.view.centerXAnchor),
nextButton.centerYAnchor.constraint(equalTo: self.view.centerYAnchor, constant: 0),nextButton.heightAnchor.constraint(equalToConstant: 200),nextButton.widthAnchor.constraint(equalToConstant: 200)])


@objc func nextButtonTapped()
print("next button tapped")
self.navigationController?.pushViewController(ViewController(), animated: true)


deinit
print("view controller is deinitialized")





Ive viewed other questions listed below and tried to adopt their suggestions but none of them seemed to help



Navigation arc memory not released



Memory leak issue in navigation controller



Memory Degbugger










share|improve this question


























  • use a real iPhone not simulator and run a long time test , For example 100 pushes and pops and you will find it has a cap memory and stable below 18M(It depends on the size of image.).

    – E.Coms
    Mar 28 at 3:22











  • @E.Coms Thank you for taking the time to run it and look through it. Ive been performing all on tests on an iPhone X and an iPhone 6s Plus. I suspected the image as well so I removed the image in my tests. After running about 20-30 pushes consecutively and 20-30 consecutive pops the memory appears to grow in the memory debugger like a mountain there is a spike especially after the first pop. There are leaks reported in profiler but Ive read those can be misleading and Ive looked through the memory graph but haven't found anything helpful its a very strange phenomenon.

    – TheRedCamaro3.0 3.0
    Mar 28 at 15:01











  • I believe there are more codes and resources in your projects. It's a normal situation like this as it will be handled by system, like caching and animation optimizations. The code presented here should be fine. If there is no other bug and leaks, it will reach peaks at around 40-50M. Unless there is any leaks you may overlooked. Also you may consider to popToRoot in time. It's a rare condition to just keep pushing so many vcs. Maybe 10 layers is big enough. You can change the content of VCs, not vc it self.

    – E.Coms
    Mar 28 at 15:36











  • @E.Coms I have added a link to the repository of the complete project so you can see for yourself github.com/TheRedCamaro30/Leaky-Navigation-Controller. There is no reason that I can think of for why the views shouldn't behave as expected where the memory is released as the user swipes off a ViewController. In Theory the user should be able to add a significant number of views to the naviagtion controller as long as deallocations are being handled responsibly.

    – TheRedCamaro3.0 3.0
    Mar 28 at 16:11











  • As I said, if you hide the navigation bar and turn off all animations. The maximum memory is about 22M and can added up 100 layer+ without any problem. If you turn on the animations and navigtionbar is shown with a back button, The maximum should be 35M. The reason of peak is due to save some spaces for animation controllers and related. There is one time such jumping and never happen again.

    – E.Coms
    Mar 28 at 17:18

















0















Ive created a navigation which pushes a view controller that contains an image view and a button which adds the same view controller each time the button is tapped. After each tap the memory grows and after each back tap the memory is not released despite deinit being called. There is nothing in the code that points to a memory leak is there something I am missing thank you?



complete project repository



class ViewController: UIViewController 


lazy var nextButton:UIButton? =
let button = UIButton(type: .roundedRect)
button.setTitle("Next", for: .normal)
button.addTarget(self, action: #selector(nextButtonTapped), for: .touchUpInside)
button.translatesAutoresizingMaskIntoConstraints = false
button.backgroundColor = UIColor.red
return button
()

lazy var imageView:UIImageView? =
let image = #imageLiteral(resourceName: "DJI_0014")
let imageView = UIImageView(image: image)
imageView.translatesAutoresizingMaskIntoConstraints = false
return imageView
()

override func viewDidLoad()
super.viewDidLoad()
// Do any additional setup after loading the view.

guard let imageView = self.imageView, let nextButton = self.nextButton else
print("imageView, nextButton are nil")
return


self.view.backgroundColor = UIColor.white

self.view.addSubview(imageView)
NSLayoutConstraint.activate([
imageView.topAnchor.constraint(equalTo:self.view.topAnchor),
imageView.leadingAnchor.constraint(equalTo: self.view.leadingAnchor),
imageView.bottomAnchor.constraint(equalTo: self.view.bottomAnchor),
imageView.trailingAnchor.constraint(equalTo: self.view.trailingAnchor)])

view.addSubview(nextButton)
NSLayoutConstraint.activate([nextButton.centerXAnchor.constraint(equalTo: self.view.centerXAnchor),
nextButton.centerYAnchor.constraint(equalTo: self.view.centerYAnchor, constant: 0),nextButton.heightAnchor.constraint(equalToConstant: 200),nextButton.widthAnchor.constraint(equalToConstant: 200)])


@objc func nextButtonTapped()
print("next button tapped")
self.navigationController?.pushViewController(ViewController(), animated: true)


deinit
print("view controller is deinitialized")





Ive viewed other questions listed below and tried to adopt their suggestions but none of them seemed to help



Navigation arc memory not released



Memory leak issue in navigation controller



Memory Degbugger










share|improve this question


























  • use a real iPhone not simulator and run a long time test , For example 100 pushes and pops and you will find it has a cap memory and stable below 18M(It depends on the size of image.).

    – E.Coms
    Mar 28 at 3:22











  • @E.Coms Thank you for taking the time to run it and look through it. Ive been performing all on tests on an iPhone X and an iPhone 6s Plus. I suspected the image as well so I removed the image in my tests. After running about 20-30 pushes consecutively and 20-30 consecutive pops the memory appears to grow in the memory debugger like a mountain there is a spike especially after the first pop. There are leaks reported in profiler but Ive read those can be misleading and Ive looked through the memory graph but haven't found anything helpful its a very strange phenomenon.

    – TheRedCamaro3.0 3.0
    Mar 28 at 15:01











  • I believe there are more codes and resources in your projects. It's a normal situation like this as it will be handled by system, like caching and animation optimizations. The code presented here should be fine. If there is no other bug and leaks, it will reach peaks at around 40-50M. Unless there is any leaks you may overlooked. Also you may consider to popToRoot in time. It's a rare condition to just keep pushing so many vcs. Maybe 10 layers is big enough. You can change the content of VCs, not vc it self.

    – E.Coms
    Mar 28 at 15:36











  • @E.Coms I have added a link to the repository of the complete project so you can see for yourself github.com/TheRedCamaro30/Leaky-Navigation-Controller. There is no reason that I can think of for why the views shouldn't behave as expected where the memory is released as the user swipes off a ViewController. In Theory the user should be able to add a significant number of views to the naviagtion controller as long as deallocations are being handled responsibly.

    – TheRedCamaro3.0 3.0
    Mar 28 at 16:11











  • As I said, if you hide the navigation bar and turn off all animations. The maximum memory is about 22M and can added up 100 layer+ without any problem. If you turn on the animations and navigtionbar is shown with a back button, The maximum should be 35M. The reason of peak is due to save some spaces for animation controllers and related. There is one time such jumping and never happen again.

    – E.Coms
    Mar 28 at 17:18













0












0








0








Ive created a navigation which pushes a view controller that contains an image view and a button which adds the same view controller each time the button is tapped. After each tap the memory grows and after each back tap the memory is not released despite deinit being called. There is nothing in the code that points to a memory leak is there something I am missing thank you?



complete project repository



class ViewController: UIViewController 


lazy var nextButton:UIButton? =
let button = UIButton(type: .roundedRect)
button.setTitle("Next", for: .normal)
button.addTarget(self, action: #selector(nextButtonTapped), for: .touchUpInside)
button.translatesAutoresizingMaskIntoConstraints = false
button.backgroundColor = UIColor.red
return button
()

lazy var imageView:UIImageView? =
let image = #imageLiteral(resourceName: "DJI_0014")
let imageView = UIImageView(image: image)
imageView.translatesAutoresizingMaskIntoConstraints = false
return imageView
()

override func viewDidLoad()
super.viewDidLoad()
// Do any additional setup after loading the view.

guard let imageView = self.imageView, let nextButton = self.nextButton else
print("imageView, nextButton are nil")
return


self.view.backgroundColor = UIColor.white

self.view.addSubview(imageView)
NSLayoutConstraint.activate([
imageView.topAnchor.constraint(equalTo:self.view.topAnchor),
imageView.leadingAnchor.constraint(equalTo: self.view.leadingAnchor),
imageView.bottomAnchor.constraint(equalTo: self.view.bottomAnchor),
imageView.trailingAnchor.constraint(equalTo: self.view.trailingAnchor)])

view.addSubview(nextButton)
NSLayoutConstraint.activate([nextButton.centerXAnchor.constraint(equalTo: self.view.centerXAnchor),
nextButton.centerYAnchor.constraint(equalTo: self.view.centerYAnchor, constant: 0),nextButton.heightAnchor.constraint(equalToConstant: 200),nextButton.widthAnchor.constraint(equalToConstant: 200)])


@objc func nextButtonTapped()
print("next button tapped")
self.navigationController?.pushViewController(ViewController(), animated: true)


deinit
print("view controller is deinitialized")





Ive viewed other questions listed below and tried to adopt their suggestions but none of them seemed to help



Navigation arc memory not released



Memory leak issue in navigation controller



Memory Degbugger










share|improve this question
















Ive created a navigation which pushes a view controller that contains an image view and a button which adds the same view controller each time the button is tapped. After each tap the memory grows and after each back tap the memory is not released despite deinit being called. There is nothing in the code that points to a memory leak is there something I am missing thank you?



complete project repository



class ViewController: UIViewController 


lazy var nextButton:UIButton? =
let button = UIButton(type: .roundedRect)
button.setTitle("Next", for: .normal)
button.addTarget(self, action: #selector(nextButtonTapped), for: .touchUpInside)
button.translatesAutoresizingMaskIntoConstraints = false
button.backgroundColor = UIColor.red
return button
()

lazy var imageView:UIImageView? =
let image = #imageLiteral(resourceName: "DJI_0014")
let imageView = UIImageView(image: image)
imageView.translatesAutoresizingMaskIntoConstraints = false
return imageView
()

override func viewDidLoad()
super.viewDidLoad()
// Do any additional setup after loading the view.

guard let imageView = self.imageView, let nextButton = self.nextButton else
print("imageView, nextButton are nil")
return


self.view.backgroundColor = UIColor.white

self.view.addSubview(imageView)
NSLayoutConstraint.activate([
imageView.topAnchor.constraint(equalTo:self.view.topAnchor),
imageView.leadingAnchor.constraint(equalTo: self.view.leadingAnchor),
imageView.bottomAnchor.constraint(equalTo: self.view.bottomAnchor),
imageView.trailingAnchor.constraint(equalTo: self.view.trailingAnchor)])

view.addSubview(nextButton)
NSLayoutConstraint.activate([nextButton.centerXAnchor.constraint(equalTo: self.view.centerXAnchor),
nextButton.centerYAnchor.constraint(equalTo: self.view.centerYAnchor, constant: 0),nextButton.heightAnchor.constraint(equalToConstant: 200),nextButton.widthAnchor.constraint(equalToConstant: 200)])


@objc func nextButtonTapped()
print("next button tapped")
self.navigationController?.pushViewController(ViewController(), animated: true)


deinit
print("view controller is deinitialized")





Ive viewed other questions listed below and tried to adopt their suggestions but none of them seemed to help



Navigation arc memory not released



Memory leak issue in navigation controller



Memory Degbugger







swift xcode memory-leaks uinavigationcontroller automatic-ref-counting






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 28 at 16:07







TheRedCamaro3.0 3.0

















asked Mar 27 at 21:59









TheRedCamaro3.0 3.0TheRedCamaro3.0 3.0

3171 silver badge11 bronze badges




3171 silver badge11 bronze badges















  • use a real iPhone not simulator and run a long time test , For example 100 pushes and pops and you will find it has a cap memory and stable below 18M(It depends on the size of image.).

    – E.Coms
    Mar 28 at 3:22











  • @E.Coms Thank you for taking the time to run it and look through it. Ive been performing all on tests on an iPhone X and an iPhone 6s Plus. I suspected the image as well so I removed the image in my tests. After running about 20-30 pushes consecutively and 20-30 consecutive pops the memory appears to grow in the memory debugger like a mountain there is a spike especially after the first pop. There are leaks reported in profiler but Ive read those can be misleading and Ive looked through the memory graph but haven't found anything helpful its a very strange phenomenon.

    – TheRedCamaro3.0 3.0
    Mar 28 at 15:01











  • I believe there are more codes and resources in your projects. It's a normal situation like this as it will be handled by system, like caching and animation optimizations. The code presented here should be fine. If there is no other bug and leaks, it will reach peaks at around 40-50M. Unless there is any leaks you may overlooked. Also you may consider to popToRoot in time. It's a rare condition to just keep pushing so many vcs. Maybe 10 layers is big enough. You can change the content of VCs, not vc it self.

    – E.Coms
    Mar 28 at 15:36











  • @E.Coms I have added a link to the repository of the complete project so you can see for yourself github.com/TheRedCamaro30/Leaky-Navigation-Controller. There is no reason that I can think of for why the views shouldn't behave as expected where the memory is released as the user swipes off a ViewController. In Theory the user should be able to add a significant number of views to the naviagtion controller as long as deallocations are being handled responsibly.

    – TheRedCamaro3.0 3.0
    Mar 28 at 16:11











  • As I said, if you hide the navigation bar and turn off all animations. The maximum memory is about 22M and can added up 100 layer+ without any problem. If you turn on the animations and navigtionbar is shown with a back button, The maximum should be 35M. The reason of peak is due to save some spaces for animation controllers and related. There is one time such jumping and never happen again.

    – E.Coms
    Mar 28 at 17:18

















  • use a real iPhone not simulator and run a long time test , For example 100 pushes and pops and you will find it has a cap memory and stable below 18M(It depends on the size of image.).

    – E.Coms
    Mar 28 at 3:22











  • @E.Coms Thank you for taking the time to run it and look through it. Ive been performing all on tests on an iPhone X and an iPhone 6s Plus. I suspected the image as well so I removed the image in my tests. After running about 20-30 pushes consecutively and 20-30 consecutive pops the memory appears to grow in the memory debugger like a mountain there is a spike especially after the first pop. There are leaks reported in profiler but Ive read those can be misleading and Ive looked through the memory graph but haven't found anything helpful its a very strange phenomenon.

    – TheRedCamaro3.0 3.0
    Mar 28 at 15:01











  • I believe there are more codes and resources in your projects. It's a normal situation like this as it will be handled by system, like caching and animation optimizations. The code presented here should be fine. If there is no other bug and leaks, it will reach peaks at around 40-50M. Unless there is any leaks you may overlooked. Also you may consider to popToRoot in time. It's a rare condition to just keep pushing so many vcs. Maybe 10 layers is big enough. You can change the content of VCs, not vc it self.

    – E.Coms
    Mar 28 at 15:36











  • @E.Coms I have added a link to the repository of the complete project so you can see for yourself github.com/TheRedCamaro30/Leaky-Navigation-Controller. There is no reason that I can think of for why the views shouldn't behave as expected where the memory is released as the user swipes off a ViewController. In Theory the user should be able to add a significant number of views to the naviagtion controller as long as deallocations are being handled responsibly.

    – TheRedCamaro3.0 3.0
    Mar 28 at 16:11











  • As I said, if you hide the navigation bar and turn off all animations. The maximum memory is about 22M and can added up 100 layer+ without any problem. If you turn on the animations and navigtionbar is shown with a back button, The maximum should be 35M. The reason of peak is due to save some spaces for animation controllers and related. There is one time such jumping and never happen again.

    – E.Coms
    Mar 28 at 17:18
















use a real iPhone not simulator and run a long time test , For example 100 pushes and pops and you will find it has a cap memory and stable below 18M(It depends on the size of image.).

– E.Coms
Mar 28 at 3:22





use a real iPhone not simulator and run a long time test , For example 100 pushes and pops and you will find it has a cap memory and stable below 18M(It depends on the size of image.).

– E.Coms
Mar 28 at 3:22













@E.Coms Thank you for taking the time to run it and look through it. Ive been performing all on tests on an iPhone X and an iPhone 6s Plus. I suspected the image as well so I removed the image in my tests. After running about 20-30 pushes consecutively and 20-30 consecutive pops the memory appears to grow in the memory debugger like a mountain there is a spike especially after the first pop. There are leaks reported in profiler but Ive read those can be misleading and Ive looked through the memory graph but haven't found anything helpful its a very strange phenomenon.

– TheRedCamaro3.0 3.0
Mar 28 at 15:01





@E.Coms Thank you for taking the time to run it and look through it. Ive been performing all on tests on an iPhone X and an iPhone 6s Plus. I suspected the image as well so I removed the image in my tests. After running about 20-30 pushes consecutively and 20-30 consecutive pops the memory appears to grow in the memory debugger like a mountain there is a spike especially after the first pop. There are leaks reported in profiler but Ive read those can be misleading and Ive looked through the memory graph but haven't found anything helpful its a very strange phenomenon.

– TheRedCamaro3.0 3.0
Mar 28 at 15:01













I believe there are more codes and resources in your projects. It's a normal situation like this as it will be handled by system, like caching and animation optimizations. The code presented here should be fine. If there is no other bug and leaks, it will reach peaks at around 40-50M. Unless there is any leaks you may overlooked. Also you may consider to popToRoot in time. It's a rare condition to just keep pushing so many vcs. Maybe 10 layers is big enough. You can change the content of VCs, not vc it self.

– E.Coms
Mar 28 at 15:36





I believe there are more codes and resources in your projects. It's a normal situation like this as it will be handled by system, like caching and animation optimizations. The code presented here should be fine. If there is no other bug and leaks, it will reach peaks at around 40-50M. Unless there is any leaks you may overlooked. Also you may consider to popToRoot in time. It's a rare condition to just keep pushing so many vcs. Maybe 10 layers is big enough. You can change the content of VCs, not vc it self.

– E.Coms
Mar 28 at 15:36













@E.Coms I have added a link to the repository of the complete project so you can see for yourself github.com/TheRedCamaro30/Leaky-Navigation-Controller. There is no reason that I can think of for why the views shouldn't behave as expected where the memory is released as the user swipes off a ViewController. In Theory the user should be able to add a significant number of views to the naviagtion controller as long as deallocations are being handled responsibly.

– TheRedCamaro3.0 3.0
Mar 28 at 16:11





@E.Coms I have added a link to the repository of the complete project so you can see for yourself github.com/TheRedCamaro30/Leaky-Navigation-Controller. There is no reason that I can think of for why the views shouldn't behave as expected where the memory is released as the user swipes off a ViewController. In Theory the user should be able to add a significant number of views to the naviagtion controller as long as deallocations are being handled responsibly.

– TheRedCamaro3.0 3.0
Mar 28 at 16:11













As I said, if you hide the navigation bar and turn off all animations. The maximum memory is about 22M and can added up 100 layer+ without any problem. If you turn on the animations and navigtionbar is shown with a back button, The maximum should be 35M. The reason of peak is due to save some spaces for animation controllers and related. There is one time such jumping and never happen again.

– E.Coms
Mar 28 at 17:18





As I said, if you hide the navigation bar and turn off all animations. The maximum memory is about 22M and can added up 100 layer+ without any problem. If you turn on the animations and navigtionbar is shown with a back button, The maximum should be 35M. The reason of peak is due to save some spaces for animation controllers and related. There is one time such jumping and never happen again.

– E.Coms
Mar 28 at 17:18












1 Answer
1






active

oldest

votes


















0















Finally, I have identified the problem, which is from the navigationBar:



` navigationController?.setNavigationBarHidden(true, animated: false)`


This code will remove all the issues on large memory residues. Other parts of codes are fine. and in this situation all memory will keep around 19M all the time.



I tried to use an navigationDelegate to do the transition and found there is a crash overlooked by system and sated that if repeating push vc will make NavigationBar not layout well. So I turn it hidden and the problem has gone. But if you do need navigationBar or its animation, there would be a lot of work to do here.



But the memory issue has been found.






share|improve this answer

























  • Thank you so much for the help! We noticed the same thing when the bar and animation is removed the memory will decrease back down to where it had started. When just adding in the animation for the push and pop the memory does not go down nearly as much as it went up. Do you think this is a bug that should be filed with apple?

    – TheRedCamaro3.0 3.0
    Mar 28 at 19:39











  • I have no idea.

    – E.Coms
    Mar 28 at 20:00











  • I am a bit stumped as well. I am wondering if this is a related issue with the collectionview, stackoverflow.com/questions/55349341/…

    – TheRedCamaro3.0 3.0
    Mar 28 at 20:11










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55387116%2fnavigation-controller-not-releasing-memory-memory-leak%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0















Finally, I have identified the problem, which is from the navigationBar:



` navigationController?.setNavigationBarHidden(true, animated: false)`


This code will remove all the issues on large memory residues. Other parts of codes are fine. and in this situation all memory will keep around 19M all the time.



I tried to use an navigationDelegate to do the transition and found there is a crash overlooked by system and sated that if repeating push vc will make NavigationBar not layout well. So I turn it hidden and the problem has gone. But if you do need navigationBar or its animation, there would be a lot of work to do here.



But the memory issue has been found.






share|improve this answer

























  • Thank you so much for the help! We noticed the same thing when the bar and animation is removed the memory will decrease back down to where it had started. When just adding in the animation for the push and pop the memory does not go down nearly as much as it went up. Do you think this is a bug that should be filed with apple?

    – TheRedCamaro3.0 3.0
    Mar 28 at 19:39











  • I have no idea.

    – E.Coms
    Mar 28 at 20:00











  • I am a bit stumped as well. I am wondering if this is a related issue with the collectionview, stackoverflow.com/questions/55349341/…

    – TheRedCamaro3.0 3.0
    Mar 28 at 20:11















0















Finally, I have identified the problem, which is from the navigationBar:



` navigationController?.setNavigationBarHidden(true, animated: false)`


This code will remove all the issues on large memory residues. Other parts of codes are fine. and in this situation all memory will keep around 19M all the time.



I tried to use an navigationDelegate to do the transition and found there is a crash overlooked by system and sated that if repeating push vc will make NavigationBar not layout well. So I turn it hidden and the problem has gone. But if you do need navigationBar or its animation, there would be a lot of work to do here.



But the memory issue has been found.






share|improve this answer

























  • Thank you so much for the help! We noticed the same thing when the bar and animation is removed the memory will decrease back down to where it had started. When just adding in the animation for the push and pop the memory does not go down nearly as much as it went up. Do you think this is a bug that should be filed with apple?

    – TheRedCamaro3.0 3.0
    Mar 28 at 19:39











  • I have no idea.

    – E.Coms
    Mar 28 at 20:00











  • I am a bit stumped as well. I am wondering if this is a related issue with the collectionview, stackoverflow.com/questions/55349341/…

    – TheRedCamaro3.0 3.0
    Mar 28 at 20:11













0














0










0









Finally, I have identified the problem, which is from the navigationBar:



` navigationController?.setNavigationBarHidden(true, animated: false)`


This code will remove all the issues on large memory residues. Other parts of codes are fine. and in this situation all memory will keep around 19M all the time.



I tried to use an navigationDelegate to do the transition and found there is a crash overlooked by system and sated that if repeating push vc will make NavigationBar not layout well. So I turn it hidden and the problem has gone. But if you do need navigationBar or its animation, there would be a lot of work to do here.



But the memory issue has been found.






share|improve this answer













Finally, I have identified the problem, which is from the navigationBar:



` navigationController?.setNavigationBarHidden(true, animated: false)`


This code will remove all the issues on large memory residues. Other parts of codes are fine. and in this situation all memory will keep around 19M all the time.



I tried to use an navigationDelegate to do the transition and found there is a crash overlooked by system and sated that if repeating push vc will make NavigationBar not layout well. So I turn it hidden and the problem has gone. But if you do need navigationBar or its animation, there would be a lot of work to do here.



But the memory issue has been found.







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 28 at 18:58









E.ComsE.Coms

3,6572 gold badges4 silver badges17 bronze badges




3,6572 gold badges4 silver badges17 bronze badges















  • Thank you so much for the help! We noticed the same thing when the bar and animation is removed the memory will decrease back down to where it had started. When just adding in the animation for the push and pop the memory does not go down nearly as much as it went up. Do you think this is a bug that should be filed with apple?

    – TheRedCamaro3.0 3.0
    Mar 28 at 19:39











  • I have no idea.

    – E.Coms
    Mar 28 at 20:00











  • I am a bit stumped as well. I am wondering if this is a related issue with the collectionview, stackoverflow.com/questions/55349341/…

    – TheRedCamaro3.0 3.0
    Mar 28 at 20:11

















  • Thank you so much for the help! We noticed the same thing when the bar and animation is removed the memory will decrease back down to where it had started. When just adding in the animation for the push and pop the memory does not go down nearly as much as it went up. Do you think this is a bug that should be filed with apple?

    – TheRedCamaro3.0 3.0
    Mar 28 at 19:39











  • I have no idea.

    – E.Coms
    Mar 28 at 20:00











  • I am a bit stumped as well. I am wondering if this is a related issue with the collectionview, stackoverflow.com/questions/55349341/…

    – TheRedCamaro3.0 3.0
    Mar 28 at 20:11
















Thank you so much for the help! We noticed the same thing when the bar and animation is removed the memory will decrease back down to where it had started. When just adding in the animation for the push and pop the memory does not go down nearly as much as it went up. Do you think this is a bug that should be filed with apple?

– TheRedCamaro3.0 3.0
Mar 28 at 19:39





Thank you so much for the help! We noticed the same thing when the bar and animation is removed the memory will decrease back down to where it had started. When just adding in the animation for the push and pop the memory does not go down nearly as much as it went up. Do you think this is a bug that should be filed with apple?

– TheRedCamaro3.0 3.0
Mar 28 at 19:39













I have no idea.

– E.Coms
Mar 28 at 20:00





I have no idea.

– E.Coms
Mar 28 at 20:00













I am a bit stumped as well. I am wondering if this is a related issue with the collectionview, stackoverflow.com/questions/55349341/…

– TheRedCamaro3.0 3.0
Mar 28 at 20:11





I am a bit stumped as well. I am wondering if this is a related issue with the collectionview, stackoverflow.com/questions/55349341/…

– TheRedCamaro3.0 3.0
Mar 28 at 20:11








Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55387116%2fnavigation-controller-not-releasing-memory-memory-leak%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현