question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Memory Leak on Modals after dismiss

See original GitHub issue

Bug Report

Ionic version:

[x] 4.0.0-beta.13

Current behavior:

When Modal (pop up) is displayed and then dismissed, it leaved Detached HTMLElement (memory leaks) behind.

Expected behavior:

Modal dismiss should clean up the memory allocation

Steps to reproduce:

The sample given at the docs is enough to produce the problem. When you have larger components used as the base for the modal, the issue becomes more dramatic.

Related code:

The code to launch the modal:

export class HomePage { constructor(public modalController: ModalController) { }

async presentProfileModal() {        
    const modal = await this.modalController.create({
        component: TestModalComponent,
        componentProps: { value: 123 }
    });

    await modal.present();
}         

}

Please find the component code below. The only added method is related to modal dismiss.

closeModal() { this.modalController.dismiss(); }


Other information:

Ionic info:

Ionic:

   ionic (Ionic CLI) : 4.2.1

System:

   NodeJS : v8.9.4
   npm    : 6.4.1
   OS     : Windows 7

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:18 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
manucorporatcommented, Dec 9, 2018

Can you please follow the issue template? Ionic 4.2.1 is not the ionic version, but the CLI version

0reactions
ionitron-bot[bot]commented, Jan 24, 2020

Thanks for the issue! This issue is being closed due to inactivity. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Thank you for using Ionic!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Memory Leak on Modals after dismiss · Issue #16648 - GitHub
When Modal (pop up) is displayed and then dismissed, it leaved Detached HTMLElement (memory leaks) behind. Expected behavior:.
Read more >
Releasing memory after modal view dismiss - Stack Overflow
The problem seems to go worst when opening modal view controllers, I guess that its memory don't get released after dismiss them.
Read more >
Memory Leak in Dismissing Modal View Cont… - Apple Community
I don't think you have a memory leak. It seems release is being sent to one or more invalid addresses in the dealloc...
Read more >
Memory leak when displaying a modal view and dismissing it ...
When an AVExportSession is finished exporting, I have my app display a modal view displaying the video and an array of images. Dismissing...
Read more >
Repeatedly presenting a modal and dismissing it causes ...
But if I present and dismiss the modal like 10 times the memory ... It can make it appear like you have lots...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found