Memory issue when I swap storyboards

Hi,

I’ve created two storyboards, 1st with main menu and 2nd with game. I placed button on main menu to go to the second storyboard with game. In game storyboard I place Back button to back to main menu.
It’s working fine, but.
I found that every time I swap between storyboards - memory increase. I wrote function (connected to buttons) to stop music and remove all actions, but it’s not help me with memory.
I’ve created empty storyboards with similar navigation buttons and check the memory - it’s increase too.
Did someone got the same problem and fix it?
Similar question: stackoverflow.com

Partially I solved the problem used:
scene.removeAllActions()
scene.removeFromParent()
let viewControllerBack = UIStoryboard(name: “MainMenu”, bundle: nil).instantiateViewController(withIdentifier: “MainMenu”)
self.dismiss(animated: false, completion: nil)

For now I have only 15Mb added every time I click on main menu to Start new game. What is the other way to clear memory?

Thanks,
Denis