I've been doing a lot of research on the web and stackoverflow communities, and I'm getting to the point of believing that SPAs take almost no advantage from the GC algorithm of today's browsers.
Our development team has been concerned with destroying useless objects in state transitions that could be causing some memory-leak, removing listeners, events linked to destroyed DOMs and all the possibilities we find on the internet. But it still has a kind of memory-leak on our SPA platform, which can be used for several hours continuously. The graph below represents the memory usage in 2 hours of SPA navigation:
Itwasajumpfrom40mbto700mbin2hours.Obviously,thereareactuallysomefeatureslikemapsandgraphicsthatjustifyhighmemoryconsumption,butevenreturningtosimplertasks,thememoryremainsthereforalongtimeuntiltheGCcomesandremovesunusedmemory.
IsthereanythingotherthanthethingsIlistedabovethatcanimproveGCinasingle-pageapplication?
WeknowthatGCcannotbecontrolledbytheclient(javascript),althoughtherearesomeeventsthattriggerthiscondition.Someuseractionslike:navigation,pageexchange,closingofwindowsandtabs,amongothers,whichinsomecasesdonothappeninaSPA.
HowcanIgetasatisfactoryresultwithmemorymanagementinaSPAsinceIdonothaveasmany"triggers" for GC activation as in a multi-page application?